[LegalizeVectorTypes] Use TLI.getVectorIdxTy instead of DAG.getIntPtrConstant.
authorCraig Topper <craig.topper@intel.com>
Fri, 12 Oct 2018 22:55:17 +0000 (22:55 +0000)
committerCraig Topper <craig.topper@intel.com>
Fri, 12 Oct 2018 22:55:17 +0000 (22:55 +0000)
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

index f4cad79..a08a41c 100644 (file)
@@ -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();