File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
llvm/test/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -3721,3 +3721,19 @@ define i1 @merge_range_check_or(i8 %a) {
37213721 %and = or i1 %cmp1 , %cmp2
37223722 ret i1 %and
37233723}
3724+
3725+ ; Just a very complicated way of checking if v1 == 0.
3726+ define i1 @complicated_zero_equality_test (i64 %v1 ) {
3727+ ; CHECK-LABEL: @complicated_zero_equality_test(
3728+ ; CHECK-NEXT: [[V2:%.*]] = trunc i64 [[V1:%.*]] to i32
3729+ ; CHECK-NEXT: [[V3:%.*]] = icmp eq i32 [[V2]], 0
3730+ ; CHECK-NEXT: [[V4:%.*]] = icmp ult i64 [[V1]], 4294967296
3731+ ; CHECK-NEXT: [[V5:%.*]] = and i1 [[V4]], [[V3]]
3732+ ; CHECK-NEXT: ret i1 [[V5]]
3733+ ;
3734+ %v2 = trunc i64 %v1 to i32
3735+ %v3 = icmp eq i32 %v2 , 0
3736+ %v4 = icmp ult i64 %v1 , 4294967296 ; 2 ^ 32
3737+ %v5 = and i1 %v4 , %v3
3738+ ret i1 %v5
3739+ }
You can’t perform that action at this time.
0 commit comments