1; RUN: opt < %s -loop-simplify -loop-extract -S | FileCheck %s 2 3@choum.addr = internal unnamed_addr constant [3 x i8*] [i8* blockaddress(@choum, %bb10), i8* blockaddress(@choum, %bb14), i8* blockaddress(@choum, %bb18)] 4 5; CHECK: define 6; no outlined function 7; CHECK-NOT: define 8 9define void @choum(i32 %arg, i32* nocapture %arg1, i32 %arg2) { 10bb: 11 %tmp = icmp sgt i32 %arg, 0 12 br i1 %tmp, label %bb3, label %bb24 13 14bb3: ; preds = %bb 15 %tmp4 = sext i32 %arg2 to i64 16 %tmp5 = getelementptr inbounds [3 x i8*], [3 x i8*]* @choum.addr, i64 0, i64 %tmp4 17 %tmp6 = load i8*, i8** %tmp5 18 %tmp7 = zext i32 %arg to i64 19 br label %bb8 20 21bb8: ; preds = %bb18, %bb3 22 %tmp9 = phi i64 [ 0, %bb3 ], [ %tmp22, %bb18 ] 23 indirectbr i8* %tmp6, [label %bb10, label %bb14, label %bb18] 24 25bb10: ; preds = %bb8 26 %tmp11 = getelementptr inbounds i32, i32* %arg1, i64 %tmp9 27 %tmp12 = load i32, i32* %tmp11 28 %tmp13 = add nsw i32 %tmp12, 1 29 store i32 %tmp13, i32* %tmp11 30 br label %bb14 31 32bb14: ; preds = %bb10, %bb8 33 %tmp15 = getelementptr inbounds i32, i32* %arg1, i64 %tmp9 34 %tmp16 = load i32, i32* %tmp15 35 %tmp17 = shl nsw i32 %tmp16, 1 36 store i32 %tmp17, i32* %tmp15 37 br label %bb18 38 39bb18: ; preds = %bb14, %bb8 40 %tmp19 = getelementptr inbounds i32, i32* %arg1, i64 %tmp9 41 %tmp20 = load i32, i32* %tmp19 42 %tmp21 = add nsw i32 %tmp20, -3 43 store i32 %tmp21, i32* %tmp19 44 %tmp22 = add nuw nsw i64 %tmp9, 1 45 %tmp23 = icmp eq i64 %tmp22, %tmp7 46 br i1 %tmp23, label %bb24, label %bb8 47 48bb24: ; preds = %bb18, %bb 49 ret void 50} 51