summaryrefslogtreecommitdiffstats
path: root/llvm/test/Analysis/BasicAA
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-12-10 01:04:47 +0000
committerChris Lattner <sabre@nondot.org>2008-12-10 01:04:47 +0000
commit2e84a548d6115677d5990dec661e39a8ba78dd54 (patch)
tree64170d03ba134eac54e2ab632322f38747a38089 /llvm/test/Analysis/BasicAA
parenta30391c31f788bd25f1a7541484d84631f2eab1c (diff)
downloadbcm5719-llvm-2e84a548d6115677d5990dec661e39a8ba78dd54.tar.gz
bcm5719-llvm-2e84a548d6115677d5990dec661e39a8ba78dd54.zip
Allow basicaa to walk through geps with identical indices in
parallel, allowing it to decide that P/Q must alias if A/B must alias in things like: P = gep A, 0, i, 1 Q = gep B, 0, i, 1 This allows GVN to delete 62 more instructions out of 403.gcc. llvm-svn: 60820
Diffstat (limited to 'llvm/test/Analysis/BasicAA')
-rw-r--r--llvm/test/Analysis/BasicAA/2008-12-09-GEP-IndicesAlias.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/test/Analysis/BasicAA/2008-12-09-GEP-IndicesAlias.ll b/llvm/test/Analysis/BasicAA/2008-12-09-GEP-IndicesAlias.ll
new file mode 100644
index 00000000000..967a36edcb3
--- /dev/null
+++ b/llvm/test/Analysis/BasicAA/2008-12-09-GEP-IndicesAlias.ll
@@ -0,0 +1,16 @@
+; RUN: llvm-as < %s | opt -aa-eval -print-all-alias-modref-info -disable-output |& grep {MustAlias:.*%R,.*%r}
+; Make sure that basicaa thinks R and r are must aliases.
+
+define i32 @test(i8 * %P) {
+entry:
+ %Q = bitcast i8* %P to {i32, i32}*
+ %R = getelementptr {i32, i32}* %Q, i32 0, i32 1
+ %S = load i32* %R
+
+ %q = bitcast i8* %P to {i32, i32}*
+ %r = getelementptr {i32, i32}* %q, i32 0, i32 1
+ %s = load i32* %r
+
+ %t = sub i32 %S, %s
+ ret i32 %t
+}
OpenPOWER on IntegriCloud