summaryrefslogtreecommitdiffstats
path: root/llvm/test/Analysis/CFLAliasAnalysis
diff options
context:
space:
mode:
authorGeorge Burgess IV <george.burgess.iv@gmail.com>2015-08-28 00:16:18 +0000
committerGeorge Burgess IV <george.burgess.iv@gmail.com>2015-08-28 00:16:18 +0000
commit68b36e01da09f131f9f4cb275f3998b5b627cbca (patch)
tree9f5c2f1cf39e44fc8128323f384479ec119ee223 /llvm/test/Analysis/CFLAliasAnalysis
parentfa4ecb4b9a951fc7cce3053bcb1a3e65abcb4472 (diff)
downloadbcm5719-llvm-68b36e01da09f131f9f4cb275f3998b5b627cbca.tar.gz
bcm5719-llvm-68b36e01da09f131f9f4cb275f3998b5b627cbca.zip
Fix: CFLAA -- Mark no-args returns as unknown
Prior to this patch, we hadn't been marking StratifiedSets with the appropriate StratifiedAttrs when handling the result of no-args call instructions. This caused us to report NoAlias when handed, for example, an escaped alloca and a result from an opaque function. Now we properly mark the return value of said functions. Thanks again to Chandler, Richard, and Nick for pinging me about this. Differential review: http://reviews.llvm.org/D12408 llvm-svn: 246240
Diffstat (limited to 'llvm/test/Analysis/CFLAliasAnalysis')
-rw-r--r--llvm/test/Analysis/CFLAliasAnalysis/opaque-call-alias.ll20
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/test/Analysis/CFLAliasAnalysis/opaque-call-alias.ll b/llvm/test/Analysis/CFLAliasAnalysis/opaque-call-alias.ll
new file mode 100644
index 00000000000..8d602ebb90a
--- /dev/null
+++ b/llvm/test/Analysis/CFLAliasAnalysis/opaque-call-alias.ll
@@ -0,0 +1,20 @@
+; We previously had a case where we would put results from a no-args call in
+; its own stratified set. This would make cases like the one in @test say that
+; nothing (except %Escapes and %Arg) can alias
+
+; RUN: opt < %s -cfl-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s
+
+; CHECK: Function: test
+; CHECK: MayAlias: i8* %Arg, i8* %Escapes
+; CHECK: MayAlias: i8* %Arg, i8* %Retrieved
+; CHECK: MayAlias: i8* %Escapes, i8* %Retrieved
+define void @test(i8* %Arg) {
+ %Noalias = alloca i8
+ %Escapes = alloca i8
+ call void @set_thepointer(i8* %Escapes)
+ %Retrieved = call i8* @get_thepointer()
+ ret void
+}
+
+declare void @set_thepointer(i8* %P)
+declare i8* @get_thepointer()
OpenPOWER on IntegriCloud