[llvm] 3fbaad5 - [VectorCombine] Add test coverage for #89390
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 22 01:01:07 PDT 2024
Author: Simon Pilgrim
Date: 2024-04-22T09:00:37+01:00
New Revision: 3fbaad5a0c67d0a04739ccf51c180c7d829200a7
URL: https://github.com/llvm/llvm-project/commit/3fbaad5a0c67d0a04739ccf51c180c7d829200a7
DIFF: https://github.com/llvm/llvm-project/commit/3fbaad5a0c67d0a04739ccf51c180c7d829200a7.diff
LOG: [VectorCombine] Add test coverage for #89390
Added:
Modified:
llvm/test/Transforms/VectorCombine/X86/shuffle-of-binops.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/VectorCombine/X86/shuffle-of-binops.ll b/llvm/test/Transforms/VectorCombine/X86/shuffle-of-binops.ll
index e2ff343944cf2a..6412d6dbf701a3 100644
--- a/llvm/test/Transforms/VectorCombine/X86/shuffle-of-binops.ll
+++ b/llvm/test/Transforms/VectorCombine/X86/shuffle-of-binops.ll
@@ -199,6 +199,23 @@ define <16 x i16> @shuf_and_v16i16_yy_expensive_shuf(<16 x i16> %x, <16 x i16> %
%r = shufflevector <16 x i16> %b0, <16 x i16> %b1, <16 x i32> <i32 15, i32 22, i32 25, i32 13, i32 28, i32 0, i32 poison, i32 3, i32 0, i32 30, i32 3, i32 7, i32 9, i32 19, i32 2, i32 22>
ret <16 x i16> %r
}
+
+; TODO: negative test - don't fold shuffle(divrem(x,y),divrem(z,w)) if mask contains poison (PR89390)
+
+define <4 x i32> @shuf_srem_v4i32_poison(<4 x i32> %a0, <4 x i32> %a1) {
+; CHECK-LABEL: define <4 x i32> @shuf_srem_v4i32_poison(
+; CHECK-SAME: <4 x i32> [[A0:%.*]], <4 x i32> [[A1:%.*]]) #[[ATTR0]] {
+; CHECK-NEXT: [[TMP1:%.*]] = shufflevector <4 x i32> [[A1]], <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> <i32 0, i32 poison, i32 6, i32 3>
+; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <4 x i32> [[A0]], <4 x i32> poison, <4 x i32> <i32 0, i32 poison, i32 2, i32 3>
+; CHECK-NEXT: [[R:%.*]] = srem <4 x i32> [[TMP1]], [[TMP2]]
+; CHECK-NEXT: ret <4 x i32> [[R]]
+;
+ %srem0 = srem <4 x i32> %a1, %a0
+ %srem1 = srem <4 x i32> <i32 1, i32 1, i32 1, i32 1>, %a0
+ %r = shufflevector <4 x i32> %srem0, <4 x i32> %srem1, <4 x i32> <i32 0, i32 poison, i32 6, i32 3>
+ ret <4 x i32> %r
+}
+
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; AVX: {{.*}}
; SSE: {{.*}}
More information about the llvm-commits
mailing list