[PATCH] D34641: Fix the bug when handling shufflevector for aarch64.
Dehao Chen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 26 13:07:05 PDT 2017
danielcdh created this revision.
Herald added subscribers: kristof.beyls, javed.absar, sanjoy, rengolin, aemerson.
This Fixes https://bugs.llvm.org/show_bug.cgi?id=33600
https://reviews.llvm.org/D34641
Files:
lib/Target/AArch64/AArch64ISelLowering.cpp
test/CodeGen/AArch64/pr33600.ll
Index: test/CodeGen/AArch64/pr33600.ll
===================================================================
--- /dev/null
+++ test/CodeGen/AArch64/pr33600.ll
@@ -0,0 +1,11 @@
+; RUN: llc < %s
+
+target triple = "aarch64-unknown-linux-gnu"
+
+define <4 x i1> @foo(<12 x i64 *>* %p) {
+ %l = load <12 x i64 *>, <12 x i64 *>* %p
+ %s1 = shufflevector <12 x i64 *> %l, <12 x i64 *> undef, <4 x i32> <i32 0, i32 3, i32 6, i32 9>
+ %s2 = shufflevector <12 x i64 *> %l, <12 x i64 *> undef, <4 x i32> <i32 1, i32 4, i32 7, i32 10>
+ %ret = icmp ne <4 x i64 *> %s1, %s2
+ ret <4 x i1> %ret
+}
Index: lib/Target/AArch64/AArch64ISelLowering.cpp
===================================================================
--- lib/Target/AArch64/AArch64ISelLowering.cpp
+++ lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -7561,8 +7561,9 @@
// Convert the integer vector to pointer vector if the element is pointer.
if (EltTy->isPointerTy())
- SubVec = Builder.CreateIntToPtr(SubVec, SVI->getType());
-
+ SubVec = Builder.CreateIntToPtr(
+ SubVec, VectorType::get(SVI->getType()->getVectorElementType(),
+ VecTy->getVectorNumElements()));
SubVecs[SVI].push_back(SubVec);
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34641.104011.patch
Type: text/x-patch
Size: 1247 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170626/41b2525c/attachment.bin>
More information about the llvm-commits
mailing list