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-09-03-ReadNone.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-09-03-ReadNone.ll')
-rw-r--r-- | llvm/test/Transforms/FunctionAttrs/2008-09-03-ReadNone.ll | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/Transforms/FunctionAttrs/2008-09-03-ReadNone.ll b/llvm/test/Transforms/FunctionAttrs/2008-09-03-ReadNone.ll new file mode 100644 index 00000000000..a17d381eec8 --- /dev/null +++ b/llvm/test/Transforms/FunctionAttrs/2008-09-03-ReadNone.ll @@ -0,0 +1,18 @@ +; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | grep readnone | count 4 +@x = global i32 0 + +declare i32 @e() readnone + +define i32 @f() { + %tmp = call i32 @e( ) ; <i32> [#uses=1] + ret i32 %tmp +} + +define i32 @g() readonly { + ret i32 0 +} + +define i32 @h() readnone { + %tmp = load i32* @x ; <i32> [#uses=1] + ret i32 %tmp +} |