summaryrefslogtreecommitdiffstats
path: root/llvm/test/Regression/Transforms/SimplifyCFG/switch_formation.ll
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-02-28 21:30:39 +0000
committerChris Lattner <sabre@nondot.org>2004-02-28 21:30:39 +0000
commitc116ede471a8dfcc5875a1a3afa4a6724b5948d9 (patch)
treeccb85675ea1ff6ea940ffdd2415e6d95ea097cff /llvm/test/Regression/Transforms/SimplifyCFG/switch_formation.ll
parentd3e6ae263caeedfa4ca6dac1a4781ace2853038a (diff)
downloadbcm5719-llvm-c116ede471a8dfcc5875a1a3afa4a6724b5948d9.tar.gz
bcm5719-llvm-c116ede471a8dfcc5875a1a3afa4a6724b5948d9.zip
Add a testcase for switch instruction induction
llvm-svn: 11965
Diffstat (limited to 'llvm/test/Regression/Transforms/SimplifyCFG/switch_formation.ll')
-rw-r--r--llvm/test/Regression/Transforms/SimplifyCFG/switch_formation.ll36
1 files changed, 36 insertions, 0 deletions
diff --git a/llvm/test/Regression/Transforms/SimplifyCFG/switch_formation.ll b/llvm/test/Regression/Transforms/SimplifyCFG/switch_formation.ll
new file mode 100644
index 00000000000..f225e8dd0de
--- /dev/null
+++ b/llvm/test/Regression/Transforms/SimplifyCFG/switch_formation.ll
@@ -0,0 +1,36 @@
+; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep 'br'
+
+bool %_ZN4llvm11SetCondInst7classofEPKNS_11InstructionE({uint, uint}* %I) {
+entry:
+ %tmp.1.i = getelementptr {uint, uint}* %I, long 0, ubyte 1
+ %tmp.2.i = load uint* %tmp.1.i
+ %tmp.2 = seteq uint %tmp.2.i, 14
+ br bool %tmp.2, label %shortcirc_done.4, label %shortcirc_next.0
+
+shortcirc_next.0: ; preds = %entry
+ %tmp.6 = seteq uint %tmp.2.i, 15 ; <bool> [#uses=1]
+ br bool %tmp.6, label %shortcirc_done.4, label %shortcirc_next.1
+
+shortcirc_next.1: ; preds = %shortcirc_next.0
+ %tmp.11 = seteq uint %tmp.2.i, 16 ; <bool> [#uses=1]
+ br bool %tmp.11, label %shortcirc_done.4, label %shortcirc_next.2
+
+shortcirc_next.2: ; preds = %shortcirc_next.1
+ %tmp.16 = seteq uint %tmp.2.i, 17 ; <bool> [#uses=1]
+ br bool %tmp.16, label %shortcirc_done.4, label %shortcirc_next.3
+
+shortcirc_next.3: ; preds = %shortcirc_next.2
+ %tmp.21 = seteq uint %tmp.2.i, 18 ; <bool> [#uses=1]
+ br bool %tmp.21, label %shortcirc_done.4, label %shortcirc_next.4
+
+shortcirc_next.4: ; preds = %shortcirc_next.3
+ %tmp.26 = seteq uint %tmp.2.i, 19 ; <bool> [#uses=1]
+ br label %UnifiedReturnBlock
+
+shortcirc_done.4: ; preds = %entry, %shortcirc_next.0, %shortcirc_next.1, %shortcirc_next.2, %shortcirc_next.3
+ br label %UnifiedReturnBlock
+
+UnifiedReturnBlock: ; preds = %shortcirc_next.4, %shortcirc_done.4
+ %UnifiedRetVal = phi bool [ %tmp.26, %shortcirc_next.4 ], [ true, %shortcirc_done.4 ] ; <bool> [#uses=1]
+ ret bool %UnifiedRetVal
+}
OpenPOWER on IntegriCloud