summaryrefslogtreecommitdiffstats
path: root/llvm/test/Analysis/BasicAA
diff options
context:
space:
mode:
authorMichael Kuperstein <michael.m.kuperstein@intel.com>2013-05-28 08:17:48 +0000
committerMichael Kuperstein <michael.m.kuperstein@intel.com>2013-05-28 08:17:48 +0000
commitf3e663af3961dfbe0c647474aa92e8fb957fb2ac (patch)
treef74daec7b29625647486ea9ca0236044034f25fb /llvm/test/Analysis/BasicAA
parent9f82df295e59bcdef10b93e541b164ebccfe6bb2 (diff)
downloadbcm5719-llvm-f3e663af3961dfbe0c647474aa92e8fb957fb2ac.tar.gz
bcm5719-llvm-f3e663af3961dfbe0c647474aa92e8fb957fb2ac.zip
Make BasicAliasAnalysis recognize the fact a noalias argument cannot alias another argument, even if the other argument is not itself marked noalias.
llvm-svn: 182755
Diffstat (limited to 'llvm/test/Analysis/BasicAA')
-rw-r--r--llvm/test/Analysis/BasicAA/noalias-param.ll23
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/test/Analysis/BasicAA/noalias-param.ll b/llvm/test/Analysis/BasicAA/noalias-param.ll
new file mode 100644
index 00000000000..6494771fc59
--- /dev/null
+++ b/llvm/test/Analysis/BasicAA/noalias-param.ll
@@ -0,0 +1,23 @@
+; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info 2>&1 | FileCheck %s
+
+declare i32* @captures(i32* %cap) nounwind readonly
+
+define void @no(i32* noalias %a, i32* %b) nounwind {
+entry:
+ store i32 1, i32* %a
+ %cap = call i32* @captures(i32* %a) nounwind readonly
+ %l = load i32* %b
+ ret void
+}
+
+; CHECK: NoAlias: i32* %a, i32* %b
+
+define void @yes(i32* %c, i32* %d) nounwind {
+entry:
+ store i32 1, i32* %c
+ %cap = call i32* @captures(i32* %c) nounwind readonly
+ %l = load i32* %d
+ ret void
+}
+
+; CHECK: MayAlias: i32* %c, i32* %d
OpenPOWER on IntegriCloud