diff options
| author | Nick Lewycky <nicholas@mxc.ca> | 2014-05-30 02:31:27 +0000 |
|---|---|---|
| committer | Nick Lewycky <nicholas@mxc.ca> | 2014-05-30 02:31:27 +0000 |
| commit | 59633cb4786309931255ced99e98ab77a03acc4b (patch) | |
| tree | 9c6092efabb0df764deffcb88f5e18b890bc92f5 /llvm/test/Transforms/FunctionAttrs | |
| parent | e27de09de83d902078eff15f1018494b53ac119c (diff) | |
| download | bcm5719-llvm-59633cb4786309931255ced99e98ab77a03acc4b.tar.gz bcm5719-llvm-59633cb4786309931255ced99e98ab77a03acc4b.zip | |
When analyzing params/args for readnone/readonly, don't forget to consider that a pointer argument may be passed through a callsite to the return, and that we may need to analyze it. Fixes a bug reported on llvm-dev: http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-May/073098.html
llvm-svn: 209870
Diffstat (limited to 'llvm/test/Transforms/FunctionAttrs')
| -rw-r--r-- | llvm/test/Transforms/FunctionAttrs/nocapture.ll | 2 | ||||
| -rw-r--r-- | llvm/test/Transforms/FunctionAttrs/readattrs.ll | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/llvm/test/Transforms/FunctionAttrs/nocapture.ll b/llvm/test/Transforms/FunctionAttrs/nocapture.ll index d2460c0b6de..d3842c8415c 100644 --- a/llvm/test/Transforms/FunctionAttrs/nocapture.ll +++ b/llvm/test/Transforms/FunctionAttrs/nocapture.ll @@ -68,7 +68,7 @@ define i1* @lookup_bit(i32* %q, i32 %bitno) readnone nounwind { ret i1* %lookup } -; CHECK: define i1 @c7(i32* readnone %q, i32 %bitno) +; CHECK: define i1 @c7(i32* readonly %q, i32 %bitno) define i1 @c7(i32* %q, i32 %bitno) { %ptr = call i1* @lookup_bit(i32* %q, i32 %bitno) %val = load i1* %ptr diff --git a/llvm/test/Transforms/FunctionAttrs/readattrs.ll b/llvm/test/Transforms/FunctionAttrs/readattrs.ll index 7ae38bbb102..b4e904cf9b0 100644 --- a/llvm/test/Transforms/FunctionAttrs/readattrs.ll +++ b/llvm/test/Transforms/FunctionAttrs/readattrs.ll @@ -51,3 +51,17 @@ define void @test6_2(i8** %p, i8* %q) { define void @test7_1(i32* inalloca %a) { ret void } + +; CHECK: define i32* @test8_1(i32* readnone %p) +define i32* @test8_1(i32* %p) { +entry: + ret i32* %p +} + +; CHECK: define void @test8_2(i32* %p) +define void @test8_2(i32* %p) { +entry: + %call = call i32* @test8_1(i32* %p) + store i32 10, i32* %call, align 4 + ret void +} |

