mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-18 10:31:57 +00:00
e4dc717585
OnlyReadsMemoryFns tables are dead! We get more, and more accurate, information from gcc via the readnone and readonly function attributes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44288 91177308-0d34-0410-b5e6-96231b3b80d8
13 lines
408 B
LLVM
13 lines
408 B
LLVM
; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | not grep sub
|
|
|
|
declare i32 @strlen(i8*) readonly
|
|
|
|
define i32 @test(i8* %P) {
|
|
%X = call i32 @strlen( i8* %P ) readonly ; <i32> [#uses=2]
|
|
%A = add i32 %X, 14 ; <i32> [#uses=1]
|
|
%Y = call i32 @strlen( i8* %P ) readonly ; <i32> [#uses=1]
|
|
%Z = sub i32 %X, %Y ; <i32> [#uses=1]
|
|
%B = add i32 %A, %Z ; <i32> [#uses=1]
|
|
ret i32 %B
|
|
}
|