72 lines · plain
1; RUN: opt < %s -loop-reduce -disable-output2 3target 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"4 5target triple = "i686-apple-darwin9"6 7define ptr @foo( ptr %ABC) {8entry:9 switch i8 0, label %bb129 [10 i8 0, label %UnifiedReturnBlock11 i8 9, label %UnifiedReturnBlock12 i8 32, label %UnifiedReturnBlock13 i8 35, label %UnifiedReturnBlock14 i8 37, label %bb16.preheader15 ]16 17bb16.preheader: ; preds = %entry18 br label %bb1619 20bb16: ; preds = %cond_next102, %bb16.preheader21 %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_next10224 25cond_next102: ; preds = %bb1626 %tmp138145.rec = add i32 %ABC.2146.0.rec, 3 ; <i32> [#uses=1]27 %tmp138145 = getelementptr i8, ptr %ABC, i32 %tmp138145.rec ; <ptr> [#uses=4]28 %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1]29 switch i8 0, label %bb129.loopexit [30 i8 0, label %UnifiedReturnBlock.loopexit31 i8 9, label %UnifiedReturnBlock.loopexit32 i8 32, label %UnifiedReturnBlock.loopexit33 i8 35, label %UnifiedReturnBlock.loopexit34 i8 37, label %bb1635 ]36 37bb129.loopexit: ; preds = %cond_next10238 br label %bb12939 40bb129: ; preds = %bb129.loopexit, %entry41 ret ptr null42 43UnifiedReturnBlock.loopexit: ; preds = %cond_next102, %cond_next102, %cond_next102, %cond_next102, %bb1644 %UnifiedRetVal.ph = phi ptr [ %tmp138145, %cond_next102 ], [ %tmp138145, %cond_next102 ], [ %tmp138145, %cond_next102 ], [ %tmp138145, %cond_next102 ], [ null, %bb16 ] ; <ptr> [#uses=0]45 br label %UnifiedReturnBlock46 47UnifiedReturnBlock: ; preds = %UnifiedReturnBlock.loopexit, %entry, %entry, %entry, %entry48 ret ptr null49}50 51define ptr @bar() {52entry:53 switch i8 0, label %bb158 [54 i8 37, label %bb7455 i8 58, label %cond_true56 i8 64, label %bb1157 ]58 59bb11: ; preds = %entry60 ret ptr null61 62cond_true: ; preds = %entry63 ret ptr null64 65bb74: ; preds = %entry66 ret ptr null67 68bb158: ; preds = %entry69 ret ptr null70}71 72