From: Chris Lattner Date: Sun, 21 Feb 2010 20:15:25 +0000 (+0000) Subject: speculatively teach OPC_CheckValueType and OPC_EmitNode to handle X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=be94ffcf129f36c5515d807bb39fc3e5a02269f1 speculatively teach OPC_CheckValueType and OPC_EmitNode to handle MVT::iPTR. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96753 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/CodeGen/DAGISelHeader.h b/include/llvm/CodeGen/DAGISelHeader.h index 5d91c2bd884..f04fe34c553 100644 --- a/include/llvm/CodeGen/DAGISelHeader.h +++ b/include/llvm/CodeGen/DAGISelHeader.h @@ -420,11 +420,16 @@ SDNode *SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable, if (cast(N)->get() != (ISD::CondCode)MatcherTable[MatcherIndex++]) break; continue; - case OPC_CheckValueType: - if (cast(N)->getVT() != - (MVT::SimpleValueType)MatcherTable[MatcherIndex++]) break; + case OPC_CheckValueType: { + MVT::SimpleValueType VT = + (MVT::SimpleValueType)MatcherTable[MatcherIndex++]; + if (cast(N)->getVT() != VT) { + // Handle the case when VT is iPTR. + if (VT != MVT::iPTR || cast(N)->getVT() != TLI.getPointerTy()) + break; + } continue; - + } case OPC_CheckInteger1: if (CheckInteger(N, GetInt1(MatcherTable, MatcherIndex))) break; continue; @@ -643,8 +648,12 @@ SDNode *SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable, unsigned NumVTs = MatcherTable[MatcherIndex++]; assert(NumVTs != 0 && "Invalid node result"); SmallVector VTs; - for (unsigned i = 0; i != NumVTs; ++i) - VTs.push_back((MVT::SimpleValueType)MatcherTable[MatcherIndex++]); + for (unsigned i = 0; i != NumVTs; ++i) { + MVT::SimpleValueType VT = + (MVT::SimpleValueType)MatcherTable[MatcherIndex++]; + if (VT == MVT::iPTR) VT = TLI.getPointerTy().SimpleTy; + VTs.push_back(VT); + } // FIXME: Use faster version for the common 'one VT' case? SDVTList VTList = CurDAG->getVTList(VTs.data(), VTs.size());