Skip to content

Commit 71bf052

Browse files
committed
[SLP][NFC]Add a test for bool logic ops reduction, NFC.
1 parent c92c86f commit 71bf052

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3
2+
; RUN: opt -S < %s --passes=slp-vectorizer | FileCheck %s
3+
4+
define i1 @test(i32 %x) {
5+
; CHECK-LABEL: define i1 @test(
6+
; CHECK-SAME: i32 [[X:%.*]]) {
7+
; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[X]], 1
8+
; CHECK-NEXT: [[OP_RDX:%.*]] = or i1 poison, [[CMP]]
9+
; CHECK-NEXT: ret i1 [[OP_RDX]]
10+
;
11+
%cmp = icmp sgt i32 %x, 1
12+
%sel1 = select i1 %cmp, i1 true, i1 poison
13+
%sel2 = select i1 %sel1, i1 true, i1 poison
14+
%sel3 = select i1 %sel2, i1 true, i1 poison
15+
%sel4 = select i1 %cmp, i1 true, i1 poison
16+
%ret = or i1 %sel3, %sel4
17+
ret i1 %ret
18+
}
19+

0 commit comments

Comments
 (0)