From de984b26b1a8849b21abaee3881fa49de9946f48 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Mon, 8 Jul 2019 14:52:56 +0000 Subject: [PATCH] [X86] ISD::INSERT_SUBVECTOR - use uint64_t index. NFCI. 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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index d9eecaea7df..ca1f2668288 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -6760,12 +6760,12 @@ static bool getFauxShuffleMask(SDValue N, const APInt &DemandedElts, if (!isa(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(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), -- 2.50.0