summaryrefslogtreecommitdiff
path: root/test/Transforms/GVN/local-pre.ll
diff options
context:
space:
mode:
authorShuxin Yang <shuxin.llvm@gmail.com>2013-11-11 22:00:23 +0000
committerShuxin Yang <shuxin.llvm@gmail.com>2013-11-11 22:00:23 +0000
commit6c7a7c6474ea60c40e2dbb15f5b6cf0265098ace (patch)
tree223a5e7a94705f139fafb9a942c6c2a41cbd7d3a /test/Transforms/GVN/local-pre.ll
parent5635de519acc30856ac3081559b507679348ad26 (diff)
downloadllvm-6c7a7c6474ea60c40e2dbb15f5b6cf0265098ace.tar.gz
llvm-6c7a7c6474ea60c40e2dbb15f5b6cf0265098ace.tar.bz2
llvm-6c7a7c6474ea60c40e2dbb15f5b6cf0265098ace.tar.xz
Fix PR17952.
The symptom is that an assertion is triggered. The assertion was added by me to detect the situation when value is propagated from dead blocks. (We can certainly get rid of assertion; it is safe to do so, because propagating value from dead block to alive join node is certainly ok.) The root cause of this bug is : edge-splitting is conducted on the fly, the edge being split could be a dead edge, therefore the block that split the critial edge needs to be flagged "dead" as well. There are 3 ways to fix this bug: 1) Get rid of the assertion as I mentioned eariler 2) When an dead edge is split, flag the inserted block "dead". 3) proactively split the critical edges connecting dead and live blocks when new dead blocks are revealed. This fix go for 3) with additional 2 LOC. Testing case was added by Rafael the other day. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194424 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/GVN/local-pre.ll')
-rw-r--r--test/Transforms/GVN/local-pre.ll6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/Transforms/GVN/local-pre.ll b/test/Transforms/GVN/local-pre.ll
index 1d0dadfbe0..2c92699dca 100644
--- a/test/Transforms/GVN/local-pre.ll
+++ b/test/Transforms/GVN/local-pre.ll
@@ -1,9 +1,9 @@
; RUN: opt < %s -gvn -enable-pre -S | grep "b.pre"
-define i32 @main(i32 %p) {
+define i32 @main(i32 %p, i32 %q) {
block1:
-
- br i1 true, label %block2, label %block3
+ %cmp = icmp eq i32 %p, %q
+ br i1 %cmp, label %block2, label %block3
block2:
%a = add i32 %p, 1