From a796580903a6cb3a52533fdb054bebceacada83a Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Fri, 12 Oct 2018 22:55:17 +0000 Subject: [PATCH] [LegalizeVectorTypes] Use TLI.getVectorIdxTy instead of DAG.getIntPtrConstant. There's no guarantee that vector indices should use pointer types. So use the correct query method. llvm-svn: 344428 --- llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp index f4cad796863b..a08a41ccaf29 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp @@ -3749,8 +3749,9 @@ SDValue DAGTypeLegalizer::WidenVecOp_Convert(SDNode *N) { InVT.getVectorNumElements()); if (TLI.isTypeLegal(WideVT)) { SDValue Res = DAG.getNode(Opcode, dl, WideVT, InOp); - return DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, VT, Res, - DAG.getIntPtrConstant(0, dl)); + return DAG.getNode( + ISD::EXTRACT_SUBVECTOR, dl, VT, Res, + DAG.getConstant(0, dl, TLI.getVectorIdxTy(DAG.getDataLayout()))); } EVT InEltVT = InVT.getVectorElementType();