Fix a bug in PerformEXTRACT_VECTOR_ELTCombine. The code created an ADD SDNode
authorNadav Rotem <nadav.rotem@intel.com>
Tue, 17 May 2011 08:31:57 +0000 (08:31 +0000)
committerNadav Rotem <nadav.rotem@intel.com>
Tue, 17 May 2011 08:31:57 +0000 (08:31 +0000)
with two different types, in cases where the index and the ptr had different
types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131461 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ISelLowering.cpp

index cb39679e066f58ae4c68f150754560b41a6f18ae..ff4a283b58318462d18207fe84c8e06d31fc2f49 100644 (file)
@@ -11038,14 +11038,14 @@ static SDValue PerformEXTRACT_VECTOR_ELTCombine(SDNode *N, SelectionDAG &DAG,
        UE = Uses.end(); UI != UE; ++UI) {
     SDNode *Extract = *UI;
 
-    // Compute the element's address.
+    // cOMpute the element's address.
     SDValue Idx = Extract->getOperand(1);
     unsigned EltSize =
         InputVector.getValueType().getVectorElementType().getSizeInBits()/8;
     uint64_t Offset = EltSize * cast<ConstantSDNode>(Idx)->getZExtValue();
     SDValue OffsetVal = DAG.getConstant(Offset, TLI.getPointerTy());
 
-    SDValue ScalarAddr = DAG.getNode(ISD::ADD, dl, Idx.getValueType(),
+    SDValue ScalarAddr = DAG.getNode(ISD::ADD, dl, TLI.getPointerTy(),
                                      StackPtr, OffsetVal);
 
     // Load the scalar.