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