diff options
author | Chris Lattner <sabre@nondot.org> | 2010-09-21 20:37:12 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-09-21 20:37:12 +0000 |
commit | 78d3af47f532d67611e7d625b505fa832d713a26 (patch) | |
tree | 9db036afafb1ecbc65b8165043f3c8a3cc802df5 /lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | |
parent | 52a261b3c1391c5fec399ddeb3fc6ee9541e8790 (diff) | |
download | external_llvm-78d3af47f532d67611e7d625b505fa832d713a26.zip external_llvm-78d3af47f532d67611e7d625b505fa832d713a26.tar.gz external_llvm-78d3af47f532d67611e7d625b505fa832d713a26.tar.bz2 |
just like they can opt into getting the root of the pattern being
matched, allow ComplexPatterns to opt into getting the parent node
of the operand being matched.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114472 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index dead5d5..7b2898d 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -2086,7 +2086,11 @@ SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable, unsigned CPNum = MatcherTable[MatcherIndex++]; unsigned RecNo = MatcherTable[MatcherIndex++]; assert(RecNo < RecordedNodes.size() && "Invalid CheckComplexPat"); - if (!CheckComplexPattern(NodeToMatch, RecordedNodes[RecNo], CPNum, + SDNode *Parent = 0; + if (NodeStack.size() > 1) + Parent = NodeStack[NodeStack.size()-2].getNode(); + + if (!CheckComplexPattern(NodeToMatch, Parent, RecordedNodes[RecNo], CPNum, RecordedNodes)) break; continue; |