fix a bug I introduced by checking the wrong node's VT in OPC_CheckChildXType
authorChris Lattner <sabre@nondot.org>
Wed, 24 Feb 2010 22:52:52 +0000 (22:52 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 24 Feb 2010 22:52:52 +0000 (22:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97074 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/DAGISelHeader.h

index 4babed87ae281b3fa9f819a03029d32c108c5051..d208acdc745e0434ba79f299092056d730374339 100644 (file)
@@ -494,9 +494,10 @@ SDNode *SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable,
       
       MVT::SimpleValueType VT =
         (MVT::SimpleValueType)MatcherTable[MatcherIndex++];
-      if (N.getOperand(ChildNo).getValueType() != VT) {
+      EVT ChildVT = N.getOperand(ChildNo).getValueType();
+      if (ChildVT != VT) {
         // Handle the case when VT is iPTR.
-        if (VT != MVT::iPTR || N.getValueType() != TLI.getPointerTy())
+        if (VT != MVT::iPTR || ChildVT != TLI.getPointerTy())
           break;
       }
       continue;