mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
Simplify negated bit test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170020 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -677,3 +677,29 @@ define i1 @test66(i64 %A, i64 %B) {
|
||||
; CHECK-NEXT: ret i1 true
|
||||
ret i1 %cmp
|
||||
}
|
||||
|
||||
define i1 @test67(i32 %A, i32 %B) {
|
||||
%neg = xor i32 %A, -1
|
||||
%shl = shl i32 1, %B
|
||||
%and = and i32 %shl, %neg
|
||||
%cmp = icmp ne i32 %and, 0
|
||||
; CHECK: @test67
|
||||
; CHECK-NEXT: %shl = shl i32 1, %B
|
||||
; CHECK-NEXT: %1 = and i32 %shl, %A
|
||||
; CHECK-NEXT: %cmp = icmp eq i32 %1, 0
|
||||
; CHECK-NEXT: ret i1 %cmp
|
||||
ret i1 %cmp
|
||||
}
|
||||
|
||||
define i1 @test68(i32 %A, i32 %B) {
|
||||
%neg = xor i32 %A, -1
|
||||
%shl = shl i32 1, %B
|
||||
%and = and i32 %shl, %neg
|
||||
%cmp = icmp eq i32 %and, 0
|
||||
; CHECK: @test68
|
||||
; CHECK-NEXT: %shl = shl i32 1, %B
|
||||
; CHECK-NEXT: %1 = and i32 %shl, %A
|
||||
; CHECK-NEXT: %cmp = icmp ne i32 %1, 0
|
||||
; CHECK-NEXT: ret i1 %cmp
|
||||
ret i1 %cmp
|
||||
}
|
||||
|
Reference in New Issue
Block a user