aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-02-21 20:15:25 +0000
committerChris Lattner <sabre@nondot.org>2010-02-21 20:15:25 +0000
commit75d3968b90380ca7ade8abf8e685cf7542cd5970 (patch)
tree8a104c6f89b6988851c9d3d545fb4c423c400700 /include
parent86d8fb6a866da128291a7932d0351976400b5d87 (diff)
downloadexternal_llvm-75d3968b90380ca7ade8abf8e685cf7542cd5970.zip
external_llvm-75d3968b90380ca7ade8abf8e685cf7542cd5970.tar.gz
external_llvm-75d3968b90380ca7ade8abf8e685cf7542cd5970.tar.bz2
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
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/DAGISelHeader.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/include/llvm/CodeGen/DAGISelHeader.h b/include/llvm/CodeGen/DAGISelHeader.h
index 5d91c2b..f04fe34 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<CondCodeSDNode>(N)->get() !=
(ISD::CondCode)MatcherTable[MatcherIndex++]) break;
continue;
- case OPC_CheckValueType:
- if (cast<VTSDNode>(N)->getVT() !=
- (MVT::SimpleValueType)MatcherTable[MatcherIndex++]) break;
+ case OPC_CheckValueType: {
+ MVT::SimpleValueType VT =
+ (MVT::SimpleValueType)MatcherTable[MatcherIndex++];
+ if (cast<VTSDNode>(N)->getVT() != VT) {
+ // Handle the case when VT is iPTR.
+ if (VT != MVT::iPTR || cast<VTSDNode>(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<EVT, 4> 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());