summaryrefslogtreecommitdiff
path: root/test/Analysis
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
commit9f5de6dadcdb9922ad8c8135a29e4abccec11671 (patch)
treed66d776783b8a00eca7d1fd2a59651d522a72b66 /test/Analysis
parentaf10fe63c6b0246635e50f480abbf3d679f69246 (diff)
downloadllvm-9f5de6dadcdb9922ad8c8135a29e4abccec11671.tar.gz
llvm-9f5de6dadcdb9922ad8c8135a29e4abccec11671.tar.bz2
llvm-9f5de6dadcdb9922ad8c8135a29e4abccec11671.tar.xz
Make BasicAliasAnalysis recognize the fact a noalias argument cannot alias another argument, even if the other argument is not itself marked noalias.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182755 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis')
-rw-r--r--test/Analysis/BasicAA/noalias-param.ll23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/Analysis/BasicAA/noalias-param.ll b/test/Analysis/BasicAA/noalias-param.ll
new file mode 100644
index 0000000000..6494771fc5
--- /dev/null
+++ b/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