mirror of
https://github.com/intel/llvm.git
synced 2026-01-21 12:19:23 +08:00
[InstCombine] Add pre-commit tests for PR66733. NFC.
This commit is contained in:
@@ -2539,3 +2539,21 @@ define i32 @and_zext_eq_odd_commuted(i32 %a) {
|
||||
%r = and i32 %not, %a
|
||||
ret i32 %r
|
||||
}
|
||||
|
||||
; Tests from PR66733
|
||||
define i32 @and_zext_eq_zero(i32 %A, i32 %C) {
|
||||
; CHECK-LABEL: @and_zext_eq_zero(
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = icmp eq i32 [[A:%.*]], 0
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = zext i1 [[TMP1]] to i32
|
||||
; CHECK-NEXT: [[TMP3:%.*]] = lshr i32 [[A]], [[C:%.*]]
|
||||
; CHECK-NEXT: [[TMP4:%.*]] = xor i32 [[TMP3]], -1
|
||||
; CHECK-NEXT: [[TMP5:%.*]] = and i32 [[TMP2]], [[TMP4]]
|
||||
; CHECK-NEXT: ret i32 [[TMP5]]
|
||||
;
|
||||
%1 = icmp eq i32 %A, 0
|
||||
%2 = zext i1 %1 to i32
|
||||
%3 = lshr i32 %A, %C
|
||||
%4 = xor i32 %3, -1
|
||||
%5 = and i32 %2, %4
|
||||
ret i32 %5
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user