diff options
author | Chris Lattner <sabre@nondot.org> | 2005-09-14 23:01:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-09-14 23:01:59 +0000 |
commit | 2175c18c4f73823ad17b7514bd7f0d66b1e25f53 (patch) | |
tree | cdd17c2a36c4edc95742e862e733fe1e57da7e3e | |
parent | b0276200e688eec35e4fddafde4e110c28539301 (diff) |
Promote xform fns to be explicit nodes in result patterns, and clean off
predicates since they will have already matched at this point.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23362 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | utils/TableGen/DAGISelEmitter.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp index 952100ced8..7f24c37ab3 100644 --- a/utils/TableGen/DAGISelEmitter.cpp +++ b/utils/TableGen/DAGISelEmitter.cpp @@ -830,7 +830,21 @@ void DAGISelEmitter::ParseAndResolveInstructions() { I->error("Operand $" + OpName + "'s type disagrees between the operand and pattern"); - ResultNodeOperands.push_back(InVal->clone()); + // Construct the result for the dest-pattern operand list. + TreePatternNode *OpNode = InVal->clone(); + + // No predicate is useful on the result. + OpNode->setPredicateFn(""); + + // Promote the xform function to be an explicit node if set. + if (Record *Xform = OpNode->getTransformFn()) { + OpNode->setTransformFn(0); + std::vector<TreePatternNode*> Children; + Children.push_back(OpNode); + OpNode = new TreePatternNode(Xform, Children); + } + + ResultNodeOperands.push_back(OpNode); } if (!InstInputsCheck.empty()) |