[PATCH] D82294: [SVE] Fix scalable vector bug in DataLayout::getIntPtrType
David Sherwood via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 23 01:01:01 PDT 2020
david-arm updated this revision to Diff 272633.
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.272633.patch
Type: text/x-patch
Size: 1450 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200623/b7cb6039/attachment-0001.bin>
More information about the llvm-commits
mailing list