[llvm] f631b9d - [VectorCombine] add shuffle tests; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 25 07:35:12 PDT 2020
Author: Sanjay Patel
Date: 2020-03-25T10:35:03-04:00
New Revision: f631b9dc36bccc98a10b2d6250e5d139f0d022a5
URL: https://github.com/llvm/llvm-project/commit/f631b9dc36bccc98a10b2d6250e5d139f0d022a5
DIFF: https://github.com/llvm/llvm-project/commit/f631b9dc36bccc98a10b2d6250e5d139f0d022a5.diff
LOG: [VectorCombine] add shuffle tests; NFC
Goes with DD76727.
Added:
Modified:
llvm/test/Transforms/VectorCombine/X86/shuffle.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/VectorCombine/X86/shuffle.ll b/llvm/test/Transforms/VectorCombine/X86/shuffle.ll
index 78d628615766..b5516544638b 100644
--- a/llvm/test/Transforms/VectorCombine/X86/shuffle.ll
+++ b/llvm/test/Transforms/VectorCombine/X86/shuffle.ll
@@ -24,6 +24,28 @@ define <4 x float> @bitcast_shuf_same_size(<4 x i32> %v) {
ret <4 x float> %r
}
+define <16 x i8> @bitcast_shuf_narrow_element_wrong_size(<2 x i32> %v) {
+; CHECK-LABEL: @bitcast_shuf_narrow_element_wrong_size(
+; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <2 x i32> [[V:%.*]], <2 x i32> undef, <4 x i32> <i32 1, i32 0, i32 1, i32 0>
+; CHECK-NEXT: [[R:%.*]] = bitcast <4 x i32> [[SHUF]] to <16 x i8>
+; CHECK-NEXT: ret <16 x i8> [[R]]
+;
+ %shuf = shufflevector <2 x i32> %v, <2 x i32> undef, <4 x i32> <i32 1, i32 0, i32 1, i32 0>
+ %r = bitcast <4 x i32> %shuf to <16 x i8>
+ ret <16 x i8> %r
+}
+
+define i128 @bitcast_shuf_narrow_element_wrong_type(<4 x i32> %v) {
+; CHECK-LABEL: @bitcast_shuf_narrow_element_wrong_type(
+; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <4 x i32> [[V:%.*]], <4 x i32> undef, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
+; CHECK-NEXT: [[R:%.*]] = bitcast <4 x i32> [[SHUF]] to i128
+; CHECK-NEXT: ret i128 [[R]]
+;
+ %shuf = shufflevector <4 x i32> %v, <4 x i32> undef, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
+ %r = bitcast <4 x i32> %shuf to i128
+ ret i128 %r
+}
+
define <4 x i32> @bitcast_shuf_wide_element(<8 x i16> %v) {
; CHECK-LABEL: @bitcast_shuf_wide_element(
; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <8 x i16> [[V:%.*]], <8 x i16> undef, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 2, i32 3, i32 2, i32 3>
More information about the llvm-commits
mailing list