aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/LoopSimplify
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2011-08-03 18:32:11 +0000
committerAndrew Trick <atrick@apple.com>2011-08-03 18:32:11 +0000
commit1009c3299be8c147ecd3fbd2d75ba1bafb2c84b1 (patch)
tree4274d096b0ac5e060841b6a5330dba08477edc21 /test/Transforms/LoopSimplify
parent1c3ff6595f944c2c9b834895e41c78c9c922f4af (diff)
downloadexternal_llvm-1009c3299be8c147ecd3fbd2d75ba1bafb2c84b1.zip
external_llvm-1009c3299be8c147ecd3fbd2d75ba1bafb2c84b1.tar.gz
external_llvm-1009c3299be8c147ecd3fbd2d75ba1bafb2c84b1.tar.bz2
SCEV: Use AssertingVH to catch dangling BasicBlock* when passes forget
to notify SCEV of a change. Add forgetLoop in a couple of those places. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136797 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/LoopSimplify')
-rw-r--r--test/Transforms/LoopSimplify/preserve-scev.ll88
1 files changed, 88 insertions, 0 deletions
diff --git a/test/Transforms/LoopSimplify/preserve-scev.ll b/test/Transforms/LoopSimplify/preserve-scev.ll
index 017a0d2..23ac7f2 100644
--- a/test/Transforms/LoopSimplify/preserve-scev.ll
+++ b/test/Transforms/LoopSimplify/preserve-scev.ll
@@ -48,3 +48,91 @@ return: ; preds = %for.body18, %for.bo
}
declare void @foo() nounwind
+
+; Notify SCEV when removing an ExitingBlock.
+; CHECK: @mergeExit
+; CHECK: while.cond191:
+; CHECK: br i1 %or.cond, label %while.body197
+; CHECK-NOT: land.rhs:
+; CHECK: ret
+define void @mergeExit(i32 %MapAttrCount) nounwind uwtable ssp {
+entry:
+ br i1 undef, label %if.then124, label %if.end126
+
+if.then124: ; preds = %entry
+ unreachable
+
+if.end126: ; preds = %entry
+ br i1 undef, label %while.body.lr.ph, label %if.end591
+
+while.body.lr.ph: ; preds = %if.end126
+ br i1 undef, label %if.end140, label %if.then137
+
+if.then137: ; preds = %while.body.lr.ph
+ unreachable
+
+if.end140: ; preds = %while.body.lr.ph
+ br i1 undef, label %while.cond191.outer, label %if.then148
+
+if.then148: ; preds = %if.end140
+ unreachable
+
+while.cond191.outer: ; preds = %if.then205, %if.end140
+ br label %while.cond191
+
+while.cond191: ; preds = %while.body197, %while.cond191.outer
+ %CppIndex.0 = phi i32 [ %inc, %while.body197 ], [ undef, %while.cond191.outer ]
+ br i1 undef, label %land.rhs, label %if.then216
+
+land.rhs: ; preds = %while.cond191
+ %inc = add i32 %CppIndex.0, 1
+ %cmp196 = icmp ult i32 %inc, %MapAttrCount
+ br i1 %cmp196, label %while.body197, label %if.then216
+
+while.body197: ; preds = %land.rhs
+ br i1 undef, label %if.then205, label %while.cond191
+
+if.then205: ; preds = %while.body197
+ br label %while.cond191.outer
+
+if.then216: ; preds = %land.rhs, %while.cond191
+ br i1 undef, label %if.else, label %if.then221
+
+if.then221: ; preds = %if.then216
+ unreachable
+
+if.else: ; preds = %if.then216
+ br i1 undef, label %if.then266, label %if.end340
+
+if.then266: ; preds = %if.else
+ switch i32 undef, label %if.else329 [
+ i32 17, label %if.then285
+ i32 19, label %if.then285
+ i32 18, label %if.then285
+ i32 15, label %if.then285
+ ]
+
+if.then285: ; preds = %if.then266, %if.then266, %if.then266, %if.then266
+ br i1 undef, label %if.then317, label %if.else324
+
+if.then317: ; preds = %if.then285
+ br label %if.end340
+
+if.else324: ; preds = %if.then285
+ unreachable
+
+if.else329: ; preds = %if.then266
+ unreachable
+
+if.end340: ; preds = %if.then317, %if.else
+ unreachable
+
+if.end591: ; preds = %if.end126
+ br i1 undef, label %cond.end, label %cond.false
+
+cond.false: ; preds = %if.end591
+ unreachable
+
+cond.end: ; preds = %if.end591
+ ret void
+}