From 74332be31efa6f06d53db4f6527121159382a40c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 19 Apr 2004 18:06:34 +0000 Subject: [PATCH] New testcase git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13067 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/LoopUnswitch/basictest.ll | 35 +++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 test/Transforms/LoopUnswitch/basictest.ll diff --git a/test/Transforms/LoopUnswitch/basictest.ll b/test/Transforms/LoopUnswitch/basictest.ll new file mode 100644 index 00000000000..12fef813b8c --- /dev/null +++ b/test/Transforms/LoopUnswitch/basictest.ll @@ -0,0 +1,35 @@ +; RUN: llvm-as < %s | opt -loop-unswitch -disable-output +implementation ; Functions: + +int %test(int* %A, bool %C) { +entry: + br label %no_exit + +no_exit: ; preds = %entry, %no_exit.backedge + %i.0.0 = phi uint [ 0, %entry ], [ %i.0.0.be, %no_exit.backedge ] ; [#uses=3] + %tmp.7 = getelementptr int* %A, uint %i.0.0 ; [#uses=4] + %tmp.13 = load int* %tmp.7 ; [#uses=1] + %tmp.14 = add int %tmp.13, 1 ; [#uses=1] + store int %tmp.14, int* %tmp.7 + br bool %C, label %then, label %endif + +then: ; preds = %no_exit + %tmp.29 = load int* %tmp.7 ; [#uses=1] + %tmp.30 = add int %tmp.29, 2 ; [#uses=1] + store int %tmp.30, int* %tmp.7 + %inc9 = add uint %i.0.0, 1 ; [#uses=2] + %tmp.112 = setlt uint %inc9, 100000 ; [#uses=1] + br bool %tmp.112, label %no_exit.backedge, label %return + +no_exit.backedge: ; preds = %then, %endif + %i.0.0.be = phi uint [ %inc9, %then ], [ %inc, %endif ] ; [#uses=1] + br label %no_exit + +endif: ; preds = %no_exit + %inc = add uint %i.0.0, 1 ; [#uses=2] + %tmp.1 = setlt uint %inc, 100000 ; [#uses=1] + br bool %tmp.1, label %no_exit.backedge, label %return + +return: ; preds = %then, %endif + ret int %tmp.13 +}