File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
llvm/test/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -3003,4 +3003,28 @@ define i1 @icmp_dec_notnonzero(i8 %x) {
3003
3003
ret i1 %c
3004
3004
}
3005
3005
3006
+ define i1 @icmp_addnuw_nonzero (i8 %x , i8 %y ) {
3007
+ ; CHECK-LABEL: @icmp_addnuw_nonzero(
3008
+ ; CHECK-NEXT: [[I:%.*]] = sub i8 0, [[Y:%.*]]
3009
+ ; CHECK-NEXT: [[C:%.*]] = icmp eq i8 [[I]], [[X:%.*]]
3010
+ ; CHECK-NEXT: ret i1 [[C]]
3011
+ ;
3012
+ %i = add nuw i8 %x , %y
3013
+ %c = icmp eq i8 %i , 0
3014
+ ret i1 %c
3015
+ }
3016
+
3017
+ define i1 @icmp_addnuw_nonzero_fail_multiuse (i32 %x , i32 %y ) {
3018
+ ; CHECK-LABEL: @icmp_addnuw_nonzero_fail_multiuse(
3019
+ ; CHECK-NEXT: [[I:%.*]] = add nuw i32 [[X:%.*]], [[Y:%.*]]
3020
+ ; CHECK-NEXT: [[C:%.*]] = icmp eq i32 [[I]], 0
3021
+ ; CHECK-NEXT: call void @use(i32 [[I]])
3022
+ ; CHECK-NEXT: ret i1 [[C]]
3023
+ ;
3024
+ %i = add nuw i32 %x , %y
3025
+ %c = icmp eq i32 %i , 0
3026
+ call void @use (i32 %i )
3027
+ ret i1 %c
3028
+ }
3029
+
3006
3030
declare void @llvm.assume (i1 )
You can’t perform that action at this time.
0 commit comments