]> granicus.if.org Git - llvm/commitdiff
[X86] ISD::INSERT_SUBVECTOR - use uint64_t index. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 8 Jul 2019 14:52:56 +0000 (14:52 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 8 Jul 2019 14:52:56 +0000 (14:52 +0000)
Keep the uint64_t type from getConstantOperandVal to stop truncation/extension overflow warnings in MSVC in subvector index math.

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

lib/Target/X86/X86ISelLowering.cpp

index d9eecaea7df0300189890cc84ba2f45c55ef34a5..ca1f2668288ca2141e7b6f6f66650b1bf86349d5 100644 (file)
@@ -6760,12 +6760,12 @@ static bool getFauxShuffleMask(SDValue N, const APInt &DemandedElts,
     if (!isa<ConstantSDNode>(N.getOperand(2)) ||
         !N->isOnlyUserOf(Sub.getNode()))
       return false;
-    int InsertIdx = N.getConstantOperandVal(2);
+    uint64_t InsertIdx = N.getConstantOperandVal(2);
     // Handle INSERT_SUBVECTOR(SRC0, EXTRACT_SUBVECTOR(SRC1)).
     if (Sub.getOpcode() == ISD::EXTRACT_SUBVECTOR &&
         Sub.getOperand(0).getValueType() == VT &&
         isa<ConstantSDNode>(Sub.getOperand(1))) {
-      int ExtractIdx = Sub.getConstantOperandVal(1);
+      uint64_t ExtractIdx = Sub.getConstantOperandVal(1);
       for (int i = 0; i != (int)NumElts; ++i)
         Mask.push_back(i);
       for (int i = 0; i != (int)NumSubElts; ++i)
@@ -43625,7 +43625,7 @@ static SDValue combineInsertSubvector(SDNode *N, SelectionDAG &DAG,
   SDValue Vec = N->getOperand(0);
   SDValue SubVec = N->getOperand(1);
 
-  unsigned IdxVal = N->getConstantOperandVal(2);
+  uint64_t IdxVal = N->getConstantOperandVal(2);
   MVT SubVecVT = SubVec.getSimpleValueType();
 
   if (Vec.isUndef() && SubVec.isUndef())
@@ -43641,7 +43641,7 @@ static SDValue combineInsertSubvector(SDNode *N, SelectionDAG &DAG,
     // just insert into the larger zero vector directly.
     if (SubVec.getOpcode() == ISD::INSERT_SUBVECTOR &&
         ISD::isBuildVectorAllZeros(SubVec.getOperand(0).getNode())) {
-      unsigned Idx2Val = SubVec.getConstantOperandVal(2);
+      uint64_t Idx2Val = SubVec.getConstantOperandVal(2);
       return DAG.getNode(ISD::INSERT_SUBVECTOR, dl, OpVT,
                          getZeroVector(OpVT, Subtarget, DAG, dl),
                          SubVec.getOperand(1),