summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-09-21 20:37:12 +0000
committerChris Lattner <sabre@nondot.org>2010-09-21 20:37:12 +0000
commitdd83548fea98f25ea24a6966bc17d29d9926269f (patch)
tree8902d00f0d1d638d558583fe943553290234a800 /llvm/lib
parent0e023ea02ac8e9e6f7c05094d4a9d7b2b0d70396 (diff)
downloadbcm5719-llvm-dd83548fea98f25ea24a6966bc17d29d9926269f.tar.gz
bcm5719-llvm-dd83548fea98f25ea24a6966bc17d29d9926269f.zip
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. llvm-svn: 114472
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index dead5d50b72..7b2898dcbfb 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud