1 ; RUN: opt < %s -loop-reduce -disable-output
3 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
5 target triple = "i686-apple-darwin9"
7 define i8* @foo( i8* %ABC) {
9 switch i8 0, label %bb129 [
10 i8 0, label %UnifiedReturnBlock
11 i8 9, label %UnifiedReturnBlock
12 i8 32, label %UnifiedReturnBlock
13 i8 35, label %UnifiedReturnBlock
14 i8 37, label %bb16.preheader
17 bb16.preheader: ; preds = %entry
20 bb16: ; preds = %cond_next102, %bb16.preheader
21 %indvar = phi i32 [ %indvar.next, %cond_next102 ], [ 0, %bb16.preheader ] ; <i32> [#uses=2]
22 %ABC.2146.0.rec = mul i32 %indvar, 3 ; <i32> [#uses=1]
23 br i1 false, label %UnifiedReturnBlock.loopexit, label %cond_next102
25 cond_next102: ; preds = %bb16
26 %tmp138145.rec = add i32 %ABC.2146.0.rec, 3 ; <i32> [#uses=1]
27 %tmp138145 = getelementptr i8* %ABC, i32 %tmp138145.rec ; <i8*> [#uses=4]
28 %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1]
29 switch i8 0, label %bb129.loopexit [
30 i8 0, label %UnifiedReturnBlock.loopexit
31 i8 9, label %UnifiedReturnBlock.loopexit
32 i8 32, label %UnifiedReturnBlock.loopexit
33 i8 35, label %UnifiedReturnBlock.loopexit
37 bb129.loopexit: ; preds = %cond_next102
40 bb129: ; preds = %bb129.loopexit, %entry
43 UnifiedReturnBlock.loopexit: ; preds = %cond_next102, %cond_next102, %cond_next102, %cond_next102, %bb16
44 %UnifiedRetVal.ph = phi i8* [ %tmp138145, %cond_next102 ], [ %tmp138145, %cond_next102 ], [ %tmp138145, %cond_next102 ], [ %tmp138145, %cond_next102 ], [ null, %bb16 ] ; <i8*> [#uses=0]
45 br label %UnifiedReturnBlock
47 UnifiedReturnBlock: ; preds = %UnifiedReturnBlock.loopexit, %entry, %entry, %entry, %entry
53 switch i8 0, label %bb158 [
55 i8 58, label %cond_true
59 bb11: ; preds = %entry
62 cond_true: ; preds = %entry
65 bb74: ; preds = %entry
68 bb158: ; preds = %entry