[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
This commit is contained in:
Craig Topper 2018-10-12 22:55:17 +00:00
parent 3d354081e0
commit a796580903
1 changed files with 3 additions and 2 deletions

View File

@ -3749,8 +3749,9 @@ SDValue DAGTypeLegalizer::WidenVecOp_Convert(SDNode *N) {
InVT.getVectorNumElements()); InVT.getVectorNumElements());
if (TLI.isTypeLegal(WideVT)) { if (TLI.isTypeLegal(WideVT)) {
SDValue Res = DAG.getNode(Opcode, dl, WideVT, InOp); SDValue Res = DAG.getNode(Opcode, dl, WideVT, InOp);
return DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, VT, Res, return DAG.getNode(
DAG.getIntPtrConstant(0, dl)); ISD::EXTRACT_SUBVECTOR, dl, VT, Res,
DAG.getConstant(0, dl, TLI.getVectorIdxTy(DAG.getDataLayout())));
} }
EVT InEltVT = InVT.getVectorElementType(); EVT InEltVT = InVT.getVectorElementType();