aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/LICM
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-12-19 05:57:25 +0000
committerChris Lattner <sabre@nondot.org>2010-12-19 05:57:25 +0000
commit1dec0d27048725cf73f73ce4f0bb97ca78255f97 (patch)
tree8978f22547105aaecdb35b23d9eaaa6f1cea8c04 /test/Transforms/LICM
parent1c0af0ed251af3d2ef795903133513656e5c369d (diff)
downloadexternal_llvm-1dec0d27048725cf73f73ce4f0bb97ca78255f97.zip
external_llvm-1dec0d27048725cf73f73ce4f0bb97ca78255f97.tar.gz
external_llvm-1dec0d27048725cf73f73ce4f0bb97ca78255f97.tar.bz2
Enhance LICM to promote alias sets whose pointers themselves are stored,
which doesn't affect the memory address being promoted. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122172 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/LICM')
-rw-r--r--test/Transforms/LICM/scalar_promote.ll30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/Transforms/LICM/scalar_promote.ll b/test/Transforms/LICM/scalar_promote.ll
index 67ad5bc..d8acdc1 100644
--- a/test/Transforms/LICM/scalar_promote.ll
+++ b/test/Transforms/LICM/scalar_promote.ll
@@ -118,3 +118,33 @@ exit:
ret void
}
+define void @test5(i32 %i, i32** noalias %P2) {
+Entry:
+ br label %Loop
+; CHECK: @test5
+; CHECK: Entry:
+; CHECK-NEXT: load i32* @X
+; CHECK-NEXT: br label %Loop
+
+
+Loop: ; preds = %Loop, %0
+ %j = phi i32 [ 0, %Entry ], [ %Next, %Loop ] ; <i32> [#uses=1]
+ %x = load i32* @X ; <i32> [#uses=1]
+ %x2 = add i32 %x, 1 ; <i32> [#uses=1]
+ store i32 %x2, i32* @X
+
+ volatile store i32* @X, i32** %P2
+
+ %Next = add i32 %j, 1 ; <i32> [#uses=2]
+ %cond = icmp eq i32 %Next, 0 ; <i1> [#uses=1]
+ br i1 %cond, label %Out, label %Loop
+
+Out:
+ ret void
+; CHECK: Out:
+; CHECK-NEXT: store i32 %x2, i32* @X
+; CHECK-NEXT: ret void
+
+}
+
+