aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/LoopSimplify
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-12-10 17:09:35 +0000
committerChris Lattner <sabre@nondot.org>2003-12-10 17:09:35 +0000
commitbaf9d2ea62c82574d2e14565d99165bf071e49b4 (patch)
treea991a073ba8dff936feb4e2bc8d0a5173667ad36 /test/Transforms/LoopSimplify
parente3cfe8d563fa06b274587aa38b1359ff707f33de (diff)
downloadexternal_llvm-baf9d2ea62c82574d2e14565d99165bf071e49b4.zip
external_llvm-baf9d2ea62c82574d2e14565d99165bf071e49b4.tar.gz
external_llvm-baf9d2ea62c82574d2e14565d99165bf071e49b4.tar.bz2
New testcase which caused a bunch of tests to break last night with more
aggressive LICM git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10372 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/LoopSimplify')
-rw-r--r--test/Transforms/LoopSimplify/2003-12-10-ExitBlocksProblem.ll42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/Transforms/LoopSimplify/2003-12-10-ExitBlocksProblem.ll b/test/Transforms/LoopSimplify/2003-12-10-ExitBlocksProblem.ll
new file mode 100644
index 0000000..126ab2c
--- /dev/null
+++ b/test/Transforms/LoopSimplify/2003-12-10-ExitBlocksProblem.ll
@@ -0,0 +1,42 @@
+; LoopSimplify is breaking LICM on this testcase because the exit blocks from
+; the loop are reachable from more than just the exit nodes: the exit blocks
+; have predecessors from outside of the loop!
+;
+; This is distilled from a monsterous crafty example.
+
+; RUN: llvm-as < %s | opt -licm | lli
+
+%G = weak global int 0 ; <int*> [#uses=13]
+
+implementation ; Functions:
+
+int %main() {
+entry:
+ store int 123, int* %G
+ br label %loopentry.i
+
+loopentry.i: ; preds = %entry, %endif.1.i
+ %tmp.0.i = load int* %G ; <int> [#uses=1]
+ %tmp.1.i = seteq int %tmp.0.i, 123 ; <bool> [#uses=1]
+ br bool %tmp.1.i, label %Out.i, label %endif.0.i
+
+endif.0.i: ; preds = %loopentry.i
+ %tmp.3.i = load int* %G ; <int> [#uses=1]
+ %tmp.4.i = seteq int %tmp.3.i, 126 ; <bool> [#uses=1]
+ br bool %tmp.4.i, label %ExitBlock.i, label %endif.1.i
+
+endif.1.i: ; preds = %endif.0.i
+ %tmp.6.i = load int* %G ; <int> [#uses=1]
+ %inc.i = add int %tmp.6.i, 1 ; <int> [#uses=1]
+ store int %inc.i, int* %G
+ br label %loopentry.i
+
+Out.i: ; preds = %loopentry.i
+ store int 0, int* %G
+ br label %ExitBlock.i
+
+ExitBlock.i: ; preds = %endif.0.i, %Out.i
+ %tmp.7.i = load int* %G ; <int> [#uses=1]
+ ret int %tmp.7.i
+}
+