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