Returns a list of dags of an operation, which use only given set of operations.
Additionally, immediate info can be provided to this function. The info describes immediate transport capabilities to the operands of the (known) operations. ImmInfo discards dags that have constant values bound to operand that can not have the immediate transported to.
- Parameters
-
opName | Name of operation whose DAGs are requested. |
opSet | Set of operations that are allowed to be referred by the returned DAGs. |
immInfo | The immediate info. |
- Returns
- List of DAGs which comply the search parameters.
Definition at line 57 of file OperationDAGSelector.cc.
60 {
61
62 OperationDAGList retDags;
65
66 for (
int i = 0; i < op.
dagCount(); i++) {
68
74 }
75
77 continue;
78 }
79
80 if (immInfo) {
81 bool discardDag = false;
82 for (
int i = 0; i < currDag.
nodeCount(); i++) {
85 if (cNode == nullptr) continue;
86
87 for (auto& edge : currDag.outEdges(*cNode)) {
91 "Operation DAG node is other than OperationNode.");
92
95 edge->dstOperand())) {
96
97
98
99
100
101
102 } else {
103 discardDag = true;
104 break;
105 }
106 }
107 if (discardDag) break;
108 }
109 if (discardDag) {
110 continue;
111 }
112 }
113 retDags.push_back(&currDag);
114 }
115
116 return retDags;
117}
#define assert(condition)
virtual Node & headNode(const Edge &edge) const
static std::string toString(const T &source)
size_t count(const ImmInfoKey &key) const
Operation & operation(const char *name)
virtual TCEString dagError(int index) const
References __func__, assert, ImmInfo::count(), countUnknownOperations(), Operation::dag(), Operation::dagCount(), Operation::dagError(), BoostGraph< GraphNode, GraphEdge >::headNode(), Operation::name(), BoostGraph< GraphNode, GraphEdge >::node(), BoostGraph< GraphNode, GraphEdge >::nodeCount(), OperationPool::operation(), BoostGraph< GraphNode, GraphEdge >::outEdges(), OperationNode::referencedOperation(), and Conversion::toString().
Referenced by TDGen::writeInstrInfo().