diff options
author | Chris Lattner <sabre@nondot.org> | 2003-02-27 21:38:56 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-02-27 21:38:56 +0000 |
commit | 8ac33045d1f100689eb8a1ad067d975bdf9a375b (patch) | |
tree | 874c9354156f46c43e4f09115e74813a3a088f1d | |
parent | 4e2fd7574af521d56d69066df2df969c761c4a33 (diff) |
Testcase for Preheaders problem
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5654 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/Transforms/LICM/2003-02-27-PreheaderProblem.ll | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/Transforms/LICM/2003-02-27-PreheaderProblem.ll b/test/Transforms/LICM/2003-02-27-PreheaderProblem.ll new file mode 100644 index 0000000000..cf3e022ab1 --- /dev/null +++ b/test/Transforms/LICM/2003-02-27-PreheaderProblem.ll @@ -0,0 +1,28 @@ +; Here we have a case where there are two loops and LICM is hoisting an +; instruction from one loop into the other loop! This is obviously bad and +; happens because preheader insertion doesn't insert a preheader for this +; case... bad. + +; RUN: if as < %s | opt -licm -adce -simplifycfg | dis | grep 'br ' +; RUN: then exit 1 +; RUN: else exit 0 +; RUN: fi + +int %main(int %argc) { + br label %bb5 + +bb5: ; preds = %bb5, %0 + %I = phi int [0, %0], [%I2, %bb5] + %I2 = add int %I, 1 + %c = seteq int %I2, 10 + br bool %c, label %bb5, label %bb8 + +bb8: ; preds = %bb8, %bb5 + %cann-indvar = phi uint [ 0, %bb8 ], [ 0, %bb5 ] + %X = add int %argc, %argc ; Loop invariant + br bool false, label %bb8, label %bb10 + +bb10: ; preds = %bb8 + ret int %X +} + |