From 608221f7aa51443ea561b9a3bb1fe67c0438a89b Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Thu, 7 Dec 2017 08:04:33 +0000 Subject: [PATCH] [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 --- lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)); } -- 2.11.0