mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
InstSimplify: X >> X -> 0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185973 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -357,6 +357,14 @@ define i1 @lshr2(i32 %x) {
|
||||
; CHECK: ret i1 false
|
||||
}
|
||||
|
||||
define i1 @lshr3(i32 %x) {
|
||||
; CHECK: @lshr3
|
||||
%s = lshr i32 %x, %x
|
||||
%c = icmp eq i32 %s, 0
|
||||
ret i1 %c
|
||||
; CHECK: ret i1 true
|
||||
}
|
||||
|
||||
define i1 @ashr1(i32 %x) {
|
||||
; CHECK: @ashr1
|
||||
%s = ashr i32 -1, %x
|
||||
@@ -373,6 +381,14 @@ define i1 @ashr2(i32 %x) {
|
||||
; CHECK: ret i1 false
|
||||
}
|
||||
|
||||
define i1 @ashr3(i32 %x) {
|
||||
; CHECK: @ashr3
|
||||
%s = ashr i32 %x, %x
|
||||
%c = icmp eq i32 %s, 0
|
||||
ret i1 %c
|
||||
; CHECK: ret i1 true
|
||||
}
|
||||
|
||||
define i1 @select1(i1 %cond) {
|
||||
; CHECK: @select1
|
||||
%s = select i1 %cond, i32 1, i32 0
|
||||
|
Reference in New Issue
Block a user