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 @@ -6240,3 +6240,19 @@ entry:
62406240 %cmp = icmp ult i8 %p0 , %p1
62416241 ret i1 %cmp
62426242}
6243+
6244+ ; Transform (x | y) > x + y into x > x + y
6245+ ; This is valid because (x | y) >= x always, so (x | y) > x + y is equivalent to x > x + y
6246+ define i1 @uaddo_or (i32 %x , i32 %y ) {
6247+ ; CHECK-LABEL: define i1 @uaddo_or(
6248+ ; CHECK-SAME: i32 [[X:%.*]], i32 [[Y:%.*]]) {
6249+ ; CHECK-NEXT: [[OR:%.*]] = or i32 [[Y]], [[X]]
6250+ ; CHECK-NEXT: [[ADD:%.*]] = add i32 [[Y]], [[X]]
6251+ ; CHECK-NEXT: [[CMP:%.*]] = icmp ugt i32 [[OR]], [[ADD]]
6252+ ; CHECK-NEXT: ret i1 [[CMP]]
6253+ ;
6254+ %or = or i32 %y , %x
6255+ %add = add i32 %y , %x
6256+ %cmp = icmp ugt i32 %or , %add
6257+ ret i1 %cmp
6258+ }
You can’t perform that action at this time.
0 commit comments