1; RUN: opt < %s -loop-unroll -S | FileCheck %s 2; RUN: opt < %s -passes='require<opt-remark-emit>,loop-unroll' -S | FileCheck %s 3 4 5; This should not unroll since the address of the loop header is taken. 6 7; CHECK-LABEL: @test1( 8; CHECK: store i8* blockaddress(@test1, %l1), i8** %P 9; CHECK: l1: 10; CHECK-NEXT: phi i32 11; rdar://8287027 12define i32 @test1(i8** %P) nounwind ssp { 13entry: 14 store i8* blockaddress(@test1, %l1), i8** %P 15 br label %l1 16 17l1: ; preds = %l1, %entry 18 %x.0 = phi i32 [ 0, %entry ], [ %inc, %l1 ] 19 %inc = add nsw i32 %x.0, 1 20 %exitcond = icmp eq i32 %inc, 3 21 br i1 %exitcond, label %l2, label %l1 22 23l2: ; preds = %l1 24 ret i32 0 25} 26 27; This should not unroll since the call is 'noduplicate'. 28 29; CHECK-LABEL: @test2( 30define i32 @test2(i8** %P) nounwind ssp { 31entry: 32 br label %l1 33 34l1: ; preds = %l1, %entry 35 %x.0 = phi i32 [ 0, %entry ], [ %inc, %l1 ] 36; CHECK: call void @f() 37; CHECK-NOT: call void @f() 38 call void @f() noduplicate 39 %inc = add nsw i32 %x.0, 1 40 %exitcond = icmp eq i32 %inc, 3 41 br i1 %exitcond, label %l2, label %l1 42 43l2: ; preds = %l1 44 ret i32 0 45; CHECK: } 46} 47 48declare void @f() 49