Skip to content

Commit e83cb31

Browse files
committed
Pre-commit test (NFC)
1 parent ff8049a commit e83cb31

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

llvm/test/CodeGen/AArch64/aarch64-bitwisenot-fold.ll

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,29 @@ define i64 @andnot_sub_with_neg_i64(i64 %a0, i64 %a1) {
9696
%and = and i64 %diff, %a0
9797
ret i64 %and
9898
}
99+
100+
define i32 @and_not_select_eq(i32 %a, i32 %b, i32 %c) {
101+
; CHECK-LABEL: and_not_select_eq:
102+
; CHECK: // %bb.0:
103+
; CHECK-NEXT: orr w8, w1, w0
104+
; CHECK-NEXT: cmp w8, w0
105+
; CHECK-NEXT: csel w0, w0, w2, eq
106+
; CHECK-NEXT: ret
107+
%or = or i32 %b, %a
108+
%cmp = icmp eq i32 %or, %a
109+
%a.c = select i1 %cmp, i32 %a, i32 %c
110+
ret i32 %a.c
111+
}
112+
113+
define i32 @and_not_select_ne(i32 %a, i32 %b, i32 %c) {
114+
; CHECK-LABEL: and_not_select_ne:
115+
; CHECK: // %bb.0:
116+
; CHECK-NEXT: orr w8, w1, w0
117+
; CHECK-NEXT: cmp w8, w0
118+
; CHECK-NEXT: csel w0, w0, w2, ne
119+
; CHECK-NEXT: ret
120+
%or = or i32 %b, %a
121+
%cmp = icmp ne i32 %or, %a
122+
%a.c = select i1 %cmp, i32 %a, i32 %c
123+
ret i32 %a.c
124+
}

0 commit comments

Comments
 (0)