aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/GVN/rle.ll
diff options
context:
space:
mode:
authorShuxin Yang <shuxin.llvm@gmail.com>2013-09-20 23:12:57 +0000
committerShuxin Yang <shuxin.llvm@gmail.com>2013-09-20 23:12:57 +0000
commitd93e8a06b2ca09ab18f390cd514b7443e2e571f7 (patch)
tree6126b1cad8f4f9182c944c0d697bb264c0348136 /test/Transforms/GVN/rle.ll
parent4a20092e638935be11e87d33f7e5b35140162bd2 (diff)
downloadexternal_llvm-d93e8a06b2ca09ab18f390cd514b7443e2e571f7.zip
external_llvm-d93e8a06b2ca09ab18f390cd514b7443e2e571f7.tar.gz
external_llvm-d93e8a06b2ca09ab18f390cd514b7443e2e571f7.tar.bz2
Resurrect r191017 " GVN proceeds in the presence of dead code" plus a fix to PR17307 & 17308.
The problem of r191017 is that when GVN fabricate a val-number for a dead instruction (in order to make following expr-PRE happy), it forget to fabricate a leader-table entry for it as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191118 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/GVN/rle.ll')
-rw-r--r--test/Transforms/GVN/rle.ll16
1 files changed, 9 insertions, 7 deletions
diff --git a/test/Transforms/GVN/rle.ll b/test/Transforms/GVN/rle.ll
index 8787dd5..a928a16 100644
--- a/test/Transforms/GVN/rle.ll
+++ b/test/Transforms/GVN/rle.ll
@@ -357,13 +357,14 @@ Cont:
; CHECK: ret i8 %A
}
-define i32 @chained_load(i32** %p) {
+define i32 @chained_load(i32** %p, i32 %x, i32 %y) {
block1:
%A = alloca i32*
%z = load i32** %p
store i32* %z, i32** %A
- br i1 true, label %block2, label %block3
+ %cmp = icmp eq i32 %x, %y
+ br i1 %cmp, label %block2, label %block3
block2:
%a = load i32** %p
@@ -427,10 +428,11 @@ TY:
ret i32 0
}
-define i32 @phi_trans3(i32* %p) {
+define i32 @phi_trans3(i32* %p, i32 %x, i32 %y, i32 %z) {
; CHECK-LABEL: @phi_trans3(
block1:
- br i1 true, label %block2, label %block3
+ %cmpxy = icmp eq i32 %x, %y
+ br i1 %cmpxy, label %block2, label %block3
block2:
store i32 87, i32* %p
@@ -443,7 +445,7 @@ block3:
block4:
%A = phi i32 [-1, %block2], [42, %block3]
- br i1 true, label %block5, label %exit
+ br i1 %cmpxy, label %block5, label %exit
; CHECK: block4:
; CHECK-NEXT: %D = phi i32 [ 87, %block2 ], [ 97, %block3 ]
@@ -451,11 +453,11 @@ block4:
block5:
%B = add i32 %A, 1
- br i1 true, label %block6, label %exit
+ br i1 %cmpxy, label %block6, label %exit
block6:
%C = getelementptr i32* %p, i32 %B
- br i1 true, label %block7, label %exit
+ br i1 %cmpxy, label %block7, label %exit
block7:
%D = load i32* %C