mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
Generalize the "trunc(ptrtoint(x)) - trunc(ptrtoint(y)) ->
trunc(ptrtoint(x-y))" optimization introduced by Chandler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152626 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -184,3 +184,12 @@ define i32 @udiv5(i32 %x, i32 %y) {
|
||||
; CHECK: ret i32 %x
|
||||
}
|
||||
|
||||
define i16 @trunc1(i32 %x) {
|
||||
; CHECK: @trunc1
|
||||
%y = add i32 %x, 1
|
||||
%tx = trunc i32 %x to i16
|
||||
%ty = trunc i32 %y to i16
|
||||
%d = sub i16 %ty, %tx
|
||||
ret i16 %d
|
||||
; CHECK: ret i16 1
|
||||
}
|
||||
|
Reference in New Issue
Block a user