teach OPC_CheckType to handle MVT::iPTR, down to 2 ppc failures.

llvm-svn: 96752
This commit is contained in:
Chris Lattner 2010-02-21 20:10:43 +00:00
parent d09d97cba4
commit 436187c7ed
1 changed files with 9 additions and 3 deletions

View File

@ -406,10 +406,16 @@ SDNode *SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable,
case OPC_CheckOpcode: case OPC_CheckOpcode:
if (N->getOpcode() != MatcherTable[MatcherIndex++]) break; if (N->getOpcode() != MatcherTable[MatcherIndex++]) break;
continue; continue;
case OPC_CheckType: case OPC_CheckType: {
if (N.getValueType() != MVT::SimpleValueType VT =
(MVT::SimpleValueType)MatcherTable[MatcherIndex++]) break; (MVT::SimpleValueType)MatcherTable[MatcherIndex++];
if (N.getValueType() != VT) {
// Handle the case when VT is iPTR.
if (VT != MVT::iPTR || N.getValueType() != TLI.getPointerTy())
break;
}
continue; continue;
}
case OPC_CheckCondCode: case OPC_CheckCondCode:
if (cast<CondCodeSDNode>(N)->get() != if (cast<CondCodeSDNode>(N)->get() !=
(ISD::CondCode)MatcherTable[MatcherIndex++]) break; (ISD::CondCode)MatcherTable[MatcherIndex++]) break;