File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
llvm/test/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,23 @@ define i1 @test4a(i32 %a) {
152152 ret i1 %c
153153}
154154
155+ define i1 @test4a_commuted (i32 %a ) {
156+ ; CHECK-LABEL: @test4a_commuted(
157+ ; CHECK-NEXT: [[L:%.*]] = ashr i32 [[A:%.*]], 31
158+ ; CHECK-NEXT: [[NA:%.*]] = sub i32 0, [[A]]
159+ ; CHECK-NEXT: [[R:%.*]] = lshr i32 [[NA]], 31
160+ ; CHECK-NEXT: [[SIGNUM:%.*]] = or i32 [[R]], [[L]]
161+ ; CHECK-NEXT: [[C:%.*]] = icmp slt i32 [[SIGNUM]], 1
162+ ; CHECK-NEXT: ret i1 [[C]]
163+ ;
164+ %l = ashr i32 %a , 31
165+ %na = sub i32 0 , %a
166+ %r = lshr i32 %na , 31
167+ %signum = or i32 %r , %l
168+ %c = icmp slt i32 %signum , 1
169+ ret i1 %c
170+ }
171+
155172define <2 x i1 > @test4a_vec (<2 x i32 > %a ) {
156173; CHECK-LABEL: @test4a_vec(
157174; CHECK-NEXT: [[C:%.*]] = icmp slt <2 x i32> [[A:%.*]], splat (i32 1)
You can’t perform that action at this time.
0 commit comments