diff options
author | Duncan Sands <baldrick@free.fr> | 2008-12-31 16:14:43 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2008-12-31 16:14:43 +0000 |
commit | 44c8cd97a508a7a12df769a1ffea29b1adb83fcc (patch) | |
tree | eb3659c3409e778290353e261c6566fb04538c8c /llvm/test/Transforms/FunctionAttrs/2008-10-04-LocalMemory.ll | |
parent | 2cc3ce000217a80509785b9ad6c866dc0b84e01e (diff) | |
download | bcm5719-llvm-44c8cd97a508a7a12df769a1ffea29b1adb83fcc.tar.gz bcm5719-llvm-44c8cd97a508a7a12df769a1ffea29b1adb83fcc.zip |
Rename AddReadAttrs to FunctionAttrs, and teach it how
to work out (in a very simplistic way) which function
arguments (pointer arguments only) are only dereferenced
and so do not escape. Mark such arguments 'nocapture'.
llvm-svn: 61525
Diffstat (limited to 'llvm/test/Transforms/FunctionAttrs/2008-10-04-LocalMemory.ll')
-rw-r--r-- | llvm/test/Transforms/FunctionAttrs/2008-10-04-LocalMemory.ll | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/test/Transforms/FunctionAttrs/2008-10-04-LocalMemory.ll b/llvm/test/Transforms/FunctionAttrs/2008-10-04-LocalMemory.ll new file mode 100644 index 00000000000..50ca6412000 --- /dev/null +++ b/llvm/test/Transforms/FunctionAttrs/2008-10-04-LocalMemory.ll @@ -0,0 +1,10 @@ +; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | grep readnone | count 2 + +declare i32 @g(i32*) readnone + +define i32 @f() { + %x = alloca i32 ; <i32*> [#uses=2] + store i32 0, i32* %x + %y = call i32 @g(i32* %x) ; <i32> [#uses=1] + ret i32 %y +} |