1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
llvm-mirror/test/Analysis/LoadVN/call_cse.ll
Duncan Sands 265752ae8f Ding dong, the DoesntAccessMemoryFns and
OnlyReadsMemoryFns tables are dead!  We
get more, and more accurate, information
from gcc via the readnone and readonly
function attributes.

llvm-svn: 44288
2007-11-23 19:30:27 +00:00

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
}