[PATCH] D82294: [SVE] Fix scalable vector bug in DataLayout::getIntPtrType

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 25 23:59:36 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG7a834a0a4ee3: [SVE] Fix scalable vector bug in DataLayout::getIntPtrType (authored by david-arm).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82294/new/

https://reviews.llvm.org/D82294

Files:
  llvm/lib/IR/DataLayout.cpp
  llvm/test/Transforms/InstCombine/vector_gep1.ll


Index: llvm/test/Transforms/InstCombine/vector_gep1.ll
===================================================================
--- llvm/test/Transforms/InstCombine/vector_gep1.ll
+++ llvm/test/Transforms/InstCombine/vector_gep1.ll
@@ -62,3 +62,13 @@
   ret <2 x i32*> %w
 }
 
+define <vscale x 2 x i1> @test8() {
+; CHECK-LABEL: @test8(
+; CHECK-NEXT:    ret <vscale x 2 x i1> icmp ult (<vscale x 2 x i64> zext (<vscale x 2 x i32> shufflevector (<vscale x 2 x i32> insertelement (<vscale x 2 x i32> undef, i32 1, i32 0), <vscale x 2 x i32> undef, <vscale x 2 x i32> zeroinitializer) to <vscale x 2 x i64>), <vscale x 2 x i64> zeroinitializer)
+;
+  %ins = insertelement <vscale x 2 x i32> undef, i32 1, i32 0
+  %b = shufflevector <vscale x 2 x i32> %ins, <vscale x 2 x i32> undef, <vscale x 2 x i32> zeroinitializer
+  %c = inttoptr <vscale x 2 x i32> %b to <vscale x 2 x i8*>
+  %d = icmp ult <vscale x 2 x i8*> %c, zeroinitializer
+  ret <vscale x 2 x i1> %d
+}
Index: llvm/lib/IR/DataLayout.cpp
===================================================================
--- llvm/lib/IR/DataLayout.cpp
+++ llvm/lib/IR/DataLayout.cpp
@@ -792,7 +792,7 @@
   unsigned NumBits = getPointerTypeSizeInBits(Ty);
   IntegerType *IntTy = IntegerType::get(Ty->getContext(), NumBits);
   if (VectorType *VecTy = dyn_cast<VectorType>(Ty))
-    return FixedVectorType::get(IntTy, VecTy->getNumElements());
+    return VectorType::get(IntTy, VecTy);
   return IntTy;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82294.273602.patch
Type: text/x-patch
Size: 1450 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200626/25f0f2df/attachment.bin>


More information about the llvm-commits mailing list