From: Craig Topper Date: Thu, 7 Dec 2017 08:04:33 +0000 (+0000) Subject: [SelectionDAG] Use TLI.getVectorIdxTy to determine type for an EXTRACT_VECTOR_ELT... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=608221f7aa51443ea561b9a3bb1fe67c0438a89b;p=llvm [SelectionDAG] Use TLI.getVectorIdxTy to determine type for an EXTRACT_VECTOR_ELT index instead of hardcoding MVT::i8. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320012 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp index bded9817b06..b574c1ea8b5 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp @@ -1754,7 +1754,8 @@ SDValue DAGTypeLegalizer::SplitVecOp_EXTRACT_VECTOR_ELT(SDNode *N) { for (unsigned i = 0; i < VecVT.getVectorNumElements(); ++i) { ElementOps.push_back(DAG.getAnyExtOrTrunc( DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl, EltVT, Vec, - DAG.getConstant(i, dl, MVT::i8)), + DAG.getConstant(i, dl, + TLI.getVectorIdxTy(DAG.getDataLayout()))), dl, MVT::i8)); }