summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorEli Friedman <efriedma@codeaurora.org>2016-12-07 19:55:59 +0000
committerEli Friedman <efriedma@codeaurora.org>2016-12-07 19:55:59 +0000
commitc6885fc369945a8fe196301b7c2357e11a4c5f20 (patch)
tree73628404e0fa3121170be64d46149d2bf3908c57 /llvm/test
parent49326e4d8467813ef08102389dbb143e329fdef9 (diff)
downloadbcm5719-llvm-c6885fc369945a8fe196301b7c2357e11a4c5f20.tar.gz
bcm5719-llvm-c6885fc369945a8fe196301b7c2357e11a4c5f20.zip
[GVNHoist] Invalidate MemDep when an instruction is moved.
See also r279907. Fixes https://llvm.org/bugs/show_bug.cgi?id=30991 . Differential Revision: https://reviews.llvm.org/D27493 llvm-svn: 288968
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/GVNHoist/hoist.ll33
1 files changed, 33 insertions, 0 deletions
diff --git a/llvm/test/Transforms/GVNHoist/hoist.ll b/llvm/test/Transforms/GVNHoist/hoist.ll
index 8e189418d72..d4b4afdd5ad 100644
--- a/llvm/test/Transforms/GVNHoist/hoist.ll
+++ b/llvm/test/Transforms/GVNHoist/hoist.ll
@@ -711,3 +711,36 @@ return: ; preds = %if.end, %if.then
; CHECK: %[[load:.*]] = load i32, i32* %y, align 1
; CHECK: %[[phi:.*]] = phi i32 [ %[[load]], %{{.*}} ], [ %[[load]], %{{.*}} ]
; CHECK: i32 %[[phi]]
+
+
+declare i8 @pr30991_f() nounwind readonly
+declare void @pr30991_f1(i8)
+define i8 @pr30991(i8* %sp, i8* %word, i1 %b1, i1 %b2) {
+entry:
+ br i1 %b1, label %a, label %b
+
+a:
+ %r0 = load i8, i8* %word, align 1
+ %incdec.ptr = getelementptr i8, i8* %sp, i32 1
+ %rr0 = call i8 @pr30991_f() nounwind readonly
+ call void @pr30991_f1(i8 %r0)
+ ret i8 %rr0
+
+b:
+ br i1 %b2, label %c, label %x
+
+c:
+ %r1 = load i8, i8* %word, align 1
+ %incdec.ptr115 = getelementptr i8, i8* %sp, i32 1
+ %rr1 = call i8 @pr30991_f() nounwind readonly
+ call void @pr30991_f1(i8 %r1)
+ ret i8 %rr1
+
+x:
+ %r2 = load i8, i8* %word, align 1
+ ret i8 %r2
+}
+
+; CHECK-LABEL: define i8 @pr30991
+; CHECK: %r0 = load i8, i8* %word, align 1
+; CHECK-NEXT: br i1 %b1, label %a, label %b
OpenPOWER on IntegriCloud