mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-14 11:39:35 +00:00
[InstSimplify] Add pre-commits for PR#66606. NFC.
This commit is contained in:
parent
47025af639
commit
2a38d83918
@ -262,3 +262,29 @@ define i1 @and_cmps_ptr_eq_zero_with_mask_commute4(ptr %p, i64 %y) {
|
||||
ret i1 %r
|
||||
}
|
||||
|
||||
; tests from PR66606
|
||||
define i32 @and_zext_eq_zero(i32 %a) {
|
||||
; CHECK-LABEL: @and_zext_eq_zero(
|
||||
; CHECK-NEXT: [[COND:%.*]] = icmp eq i32 [[A:%.*]], 0
|
||||
; CHECK-NEXT: [[NOT:%.*]] = zext i1 [[COND]] to i32
|
||||
; CHECK-NEXT: [[R:%.*]] = and i32 [[A]], [[NOT]]
|
||||
; CHECK-NEXT: ret i32 [[R]]
|
||||
;
|
||||
%cond = icmp eq i32 %a, 0
|
||||
%not = zext i1 %cond to i32
|
||||
%r = and i32 %a, %not
|
||||
ret i32 %r
|
||||
}
|
||||
|
||||
define i32 @and_zext_eq_zero_commuted(i32 %a) {
|
||||
; CHECK-LABEL: @and_zext_eq_zero_commuted(
|
||||
; CHECK-NEXT: [[COND:%.*]] = icmp eq i32 [[A:%.*]], 0
|
||||
; CHECK-NEXT: [[NOT:%.*]] = zext i1 [[COND]] to i32
|
||||
; CHECK-NEXT: [[R:%.*]] = and i32 [[NOT]], [[A]]
|
||||
; CHECK-NEXT: ret i32 [[R]]
|
||||
;
|
||||
%cond = icmp eq i32 %a, 0
|
||||
%not = zext i1 %cond to i32
|
||||
%r = and i32 %not, %a
|
||||
ret i32 %r
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user