My Project
ConstraintAnalysisGraphTraits.h
Go to the documentation of this file.
1 //===- ConstraintAnalysisGraphTraits.h - Traits for CAGs --------*- C++ -*-===//
2 //
3 // Part of the MLIR Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Provides graph traits for constraint analysis graphs.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef MLIR_QUANTIZER_SUPPORT_CONSTRAINTANALYSISGRAPHTRAITS_H
14 #define MLIR_QUANTIZER_SUPPORT_CONSTRAINTANALYSISGRAPHTRAITS_H
15 
17 #include "llvm/ADT/GraphTraits.h"
18 
19 namespace llvm {
20 
21 template <>
22 struct GraphTraits<const mlir::quantizer::CAGNode *> {
24 
25  static NodeRef getEntryNode(NodeRef node) { return node; }
26 
27  // Successors.
29  static ChildIteratorType child_begin(NodeRef node) { return node->begin(); }
30  static ChildIteratorType child_end(NodeRef node) { return node->end(); }
31 };
32 
33 template <>
34 struct GraphTraits<const mlir::quantizer::CAGSlice *>
35  : public llvm::GraphTraits<const mlir::quantizer::CAGNode *> {
39  return G->begin();
40  }
43  return G->end();
44  }
45 };
46 
47 } // end namespace llvm
48 
49 #endif // MLIR_QUANTIZER_SUPPORT_CONSTRAINTANALYSISGRAPHTRAITS_H
Definition: InferTypeOpInterface.cpp:20
const_iterator begin() const
Iterator over this node&#39;s children (outgoing) nodes.
Definition: ConstraintAnalysisGraph.h:79
Definition: ConstraintAnalysisGraph.h:45
Definition: PassRegistry.cpp:413
iterator begin()
Definition: ConstraintAnalysisGraph.h:254
A slice of a CAG (which may be the whole graph).
Definition: ConstraintAnalysisGraph.h:245
node_vector::const_iterator const_iterator
Definition: ConstraintAnalysisGraph.h:252
iterator end()
Definition: ConstraintAnalysisGraph.h:255
static mlir::quantizer::CAGSlice::const_iterator nodes_end(const mlir::quantizer::CAGSlice *G)
Definition: ConstraintAnalysisGraphTraits.h:42
static ChildIteratorType child_end(NodeRef node)
Definition: ConstraintAnalysisGraphTraits.h:30
const_iterator end() const
Definition: ConstraintAnalysisGraph.h:80
static mlir::quantizer::CAGSlice::const_iterator nodes_begin(const mlir::quantizer::CAGSlice *G)
Definition: ConstraintAnalysisGraphTraits.h:38
mlir::quantizer::CAGSlice::const_iterator nodes_iterator
Definition: ConstraintAnalysisGraphTraits.h:36
static ChildIteratorType child_begin(NodeRef node)
Definition: ConstraintAnalysisGraphTraits.h:29
mlir::quantizer::CAGNode::const_iterator ChildIteratorType
Definition: ConstraintAnalysisGraphTraits.h:28
static NodeRef getEntryNode(NodeRef node)
Definition: ConstraintAnalysisGraphTraits.h:25
node_vector::const_iterator const_iterator
Definition: ConstraintAnalysisGraph.h:64