Skip to content

Commit 3fbaad5

Browse files
committed
[VectorCombine] Add test coverage for #89390
1 parent 7f975b6 commit 3fbaad5

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

llvm/test/Transforms/VectorCombine/X86/shuffle-of-binops.ll

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,23 @@ define <16 x i16> @shuf_and_v16i16_yy_expensive_shuf(<16 x i16> %x, <16 x i16> %
199199
%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>
200200
ret <16 x i16> %r
201201
}
202+
203+
; TODO: negative test - don't fold shuffle(divrem(x,y),divrem(z,w)) if mask contains poison (PR89390)
204+
205+
define <4 x i32> @shuf_srem_v4i32_poison(<4 x i32> %a0, <4 x i32> %a1) {
206+
; CHECK-LABEL: define <4 x i32> @shuf_srem_v4i32_poison(
207+
; CHECK-SAME: <4 x i32> [[A0:%.*]], <4 x i32> [[A1:%.*]]) #[[ATTR0]] {
208+
; 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>
209+
; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <4 x i32> [[A0]], <4 x i32> poison, <4 x i32> <i32 0, i32 poison, i32 2, i32 3>
210+
; CHECK-NEXT: [[R:%.*]] = srem <4 x i32> [[TMP1]], [[TMP2]]
211+
; CHECK-NEXT: ret <4 x i32> [[R]]
212+
;
213+
%srem0 = srem <4 x i32> %a1, %a0
214+
%srem1 = srem <4 x i32> <i32 1, i32 1, i32 1, i32 1>, %a0
215+
%r = shufflevector <4 x i32> %srem0, <4 x i32> %srem1, <4 x i32> <i32 0, i32 poison, i32 6, i32 3>
216+
ret <4 x i32> %r
217+
}
218+
202219
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
203220
; AVX: {{.*}}
204221
; SSE: {{.*}}

0 commit comments

Comments
 (0)