aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms/CorrelatedValuePropagation
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2012-05-18 21:02:10 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2012-05-18 21:02:10 +0000
commit90255a85172a560da73e05dad6cdb77d8e9480e1 (patch)
tree20619d25896f15f71bb948d4a58a3e6f0ab3b233 /test/Transforms/CorrelatedValuePropagation
parent3e96531186ba574b0c25a4be62d24b8b7d752c9f (diff)
allow LazyValueInfo::getEdgeValue() to reason about multiple edges from the same switch instruction by doing union of ranges (which may still be conservative, but it's more aggressive than before)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157071 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/CorrelatedValuePropagation')
-rw-r--r--test/Transforms/CorrelatedValuePropagation/range.ll28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/Transforms/CorrelatedValuePropagation/range.ll b/test/Transforms/CorrelatedValuePropagation/range.ll
index 2bb21874ce..4ac478b0d5 100644
--- a/test/Transforms/CorrelatedValuePropagation/range.ll
+++ b/test/Transforms/CorrelatedValuePropagation/range.ll
@@ -70,3 +70,31 @@ if.then4:
if.end8:
ret i32 4
}
+
+; CHECK: @test4
+define i32 @test4(i32 %c) nounwind {
+ switch i32 %c, label %sw.default [
+ i32 1, label %sw.bb
+ i32 2, label %sw.bb
+ i32 4, label %sw.bb
+ ]
+
+; CHECK: sw.bb
+sw.bb:
+ %cmp = icmp sge i32 %c, 1
+; CHECK: br i1 true
+ br i1 %cmp, label %if.then, label %if.end
+
+if.then:
+ br label %return
+
+if.end:
+ br label %return
+
+sw.default:
+ br label %return
+
+return:
+ %retval.0 = phi i32 [ 42, %sw.default ], [ 4, %if.then ], [ 9, %if.end ]
+ ret i32 %retval.0
+}