mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
optimize:
void a(int x) { if (((1<<x)&8)==0) b(); }
into "x != 3", which occurs over 100 times in 403.gcc but in no
other program in llvm-test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119922 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -154,3 +154,41 @@ entry:
|
||||
; CHECK: @test16
|
||||
; CHECK: ret i1 undef
|
||||
}
|
||||
|
||||
define i1 @test17(i32 %x) nounwind {
|
||||
%shl = shl i32 1, %x
|
||||
%and = and i32 %shl, 8
|
||||
%cmp = icmp eq i32 %and, 0
|
||||
ret i1 %cmp
|
||||
; CHECK: @test17
|
||||
; CHECK-NEXT: %cmp = icmp eq i32 %x, 3
|
||||
}
|
||||
|
||||
|
||||
define i1 @test18(i32 %x) nounwind {
|
||||
%sh = lshr i32 8, %x
|
||||
%and = and i32 %sh, 1
|
||||
%cmp = icmp eq i32 %and, 0
|
||||
ret i1 %cmp
|
||||
; CHECK: @test18
|
||||
; CHECK-NEXT: %cmp = icmp eq i32 %x, 3
|
||||
}
|
||||
|
||||
define i1 @test19(i32 %x) nounwind {
|
||||
%shl = shl i32 1, %x
|
||||
%and = and i32 %shl, 8
|
||||
%cmp = icmp eq i32 %and, 8
|
||||
ret i1 %cmp
|
||||
; CHECK: @test19
|
||||
; CHECK-NEXT: %cmp = icmp ne i32 %x, 3
|
||||
}
|
||||
|
||||
define i1 @test20(i32 %x) nounwind {
|
||||
%shl = shl i32 1, %x
|
||||
%and = and i32 %shl, 8
|
||||
%cmp = icmp ne i32 %and, 0
|
||||
ret i1 %cmp
|
||||
; CHECK: @test20
|
||||
; CHECK-NEXT: %cmp = icmp ne i32 %x, 3
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user