diff options
author | Duncan Sands <baldrick@free.fr> | 2009-01-02 11:54:37 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2009-01-02 11:54:37 +0000 |
commit | b193a37cd3dfb8893f073e9ee17c30ddd454f474 (patch) | |
tree | 7565a373695ec95a240e701f59723be874487086 /llvm/test/Transforms/FunctionAttrs/2009-01-02-LocalStores.ll | |
parent | cefc8604aa94bab43cd74d28349fa2881014d06e (diff) | |
download | bcm5719-llvm-b193a37cd3dfb8893f073e9ee17c30ddd454f474.tar.gz bcm5719-llvm-b193a37cd3dfb8893f073e9ee17c30ddd454f474.zip |
When calculating 'nocapture' argument attributes, allow
the argument to be stored to an alloca by tracking uses
of the alloca. This occurs 4 times (out of 7121, 0.05%)
in MultiSource/Applications, so may not be worth it. On
the other hand, it is easy to do and fairly cheap. The
functions it helps are: W_addcom and W_addlit in spiff;
process_args (argv) in d (make_dparser); ercPixConcealIMB
in JM/ldecod.
llvm-svn: 61570
Diffstat (limited to 'llvm/test/Transforms/FunctionAttrs/2009-01-02-LocalStores.ll')
-rw-r--r-- | llvm/test/Transforms/FunctionAttrs/2009-01-02-LocalStores.ll | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/test/Transforms/FunctionAttrs/2009-01-02-LocalStores.ll b/llvm/test/Transforms/FunctionAttrs/2009-01-02-LocalStores.ll new file mode 100644 index 00000000000..17b443980b7 --- /dev/null +++ b/llvm/test/Transforms/FunctionAttrs/2009-01-02-LocalStores.ll @@ -0,0 +1,23 @@ +; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | not grep {nocapture *%%q} +; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | grep {nocapture *%%p} + +@g = external global i32** + +define i32 @f(i32* %p, i32* %q) { + %a1 = alloca i32* + %a2 = alloca i32** + store i32* %p, i32** %a1 + store i32** %a1, i32*** %a2 + %reload1 = load i32*** %a2 + %reload2 = load i32** %reload1 + %load_p = load i32* %reload2 + store i32 0, i32* %reload2 + + %b1 = alloca i32* + %b2 = alloca i32** + store i32* %q, i32** %b1 + store i32** %b1, i32*** %b2 + %reload3 = load i32*** %b2 + store i32** %reload3, i32*** @g + ret i32 %load_p +} |