File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
llvm/test/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -2539,3 +2539,21 @@ define i32 @and_zext_eq_odd_commuted(i32 %a) {
2539
2539
%r = and i32 %not , %a
2540
2540
ret i32 %r
2541
2541
}
2542
+
2543
+ ; Tests from PR66733
2544
+ define i32 @and_zext_eq_zero (i32 %A , i32 %C ) {
2545
+ ; CHECK-LABEL: @and_zext_eq_zero(
2546
+ ; CHECK-NEXT: [[TMP1:%.*]] = icmp eq i32 [[A:%.*]], 0
2547
+ ; CHECK-NEXT: [[TMP2:%.*]] = zext i1 [[TMP1]] to i32
2548
+ ; CHECK-NEXT: [[TMP3:%.*]] = lshr i32 [[A]], [[C:%.*]]
2549
+ ; CHECK-NEXT: [[TMP4:%.*]] = xor i32 [[TMP3]], -1
2550
+ ; CHECK-NEXT: [[TMP5:%.*]] = and i32 [[TMP2]], [[TMP4]]
2551
+ ; CHECK-NEXT: ret i32 [[TMP5]]
2552
+ ;
2553
+ %1 = icmp eq i32 %A , 0
2554
+ %2 = zext i1 %1 to i32
2555
+ %3 = lshr i32 %A , %C
2556
+ %4 = xor i32 %3 , -1
2557
+ %5 = and i32 %2 , %4
2558
+ ret i32 %5
2559
+ }
You can’t perform that action at this time.
0 commit comments