[llvm-commits] [llvm] r96753 - /llvm/trunk/include/llvm/CodeGen/DAGISelHeader.h
Chris Lattner
sabre at nondot.org
Sun Feb 21 12:15:25 PST 2010
Author: lattner
Date: Sun Feb 21 14:15:25 2010
New Revision: 96753
URL: http://llvm.org/viewvc/llvm-project?rev=96753&view=rev
Log:
speculatively teach OPC_CheckValueType and OPC_EmitNode to handle
MVT::iPTR.
Modified:
llvm/trunk/include/llvm/CodeGen/DAGISelHeader.h
Modified: llvm/trunk/include/llvm/CodeGen/DAGISelHeader.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/DAGISelHeader.h?rev=96753&r1=96752&r2=96753&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/DAGISelHeader.h (original)
+++ llvm/trunk/include/llvm/CodeGen/DAGISelHeader.h Sun Feb 21 14:15:25 2010
@@ -420,11 +420,16 @@
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 @@
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());
More information about the llvm-commits
mailing list