1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=x86-64 | FileCheck %s 2*9880d681SAndroid Build Coastguard Worker 3*9880d681SAndroid Build Coastguard Workerdefine void @test(i1 %cnd) !prof !{!"function_entry_count", i64 1024} { 4*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: @test 5*9880d681SAndroid Build Coastguard Worker; Using the assembly comments to indicate block order.. 6*9880d681SAndroid Build Coastguard Worker; CHECK: # %loop 7*9880d681SAndroid Build Coastguard Worker; CHECK: # %backedge 8*9880d681SAndroid Build Coastguard Worker; CHECK: # %exit 9*9880d681SAndroid Build Coastguard Worker; CHECK: # %rare 10*9880d681SAndroid Build Coastguard Worker; CHECK: # %rare.1 11*9880d681SAndroid Build Coastguard Worker 12*9880d681SAndroid Build Coastguard Worker br i1 undef, label %rare.1, label %preheader, !prof !{!"branch_weights", i32 0, i32 1000} 13*9880d681SAndroid Build Coastguard Workerrare.1: 14*9880d681SAndroid Build Coastguard Worker call void @foo() 15*9880d681SAndroid Build Coastguard Worker br label %preheader 16*9880d681SAndroid Build Coastguard Worker 17*9880d681SAndroid Build Coastguard Workerpreheader: 18*9880d681SAndroid Build Coastguard Worker br label %loop 19*9880d681SAndroid Build Coastguard Worker 20*9880d681SAndroid Build Coastguard Workerloop: 21*9880d681SAndroid Build Coastguard Worker %iv = phi i32 [0, %preheader], [%iv.next, %backedge] 22*9880d681SAndroid Build Coastguard Worker call void @foo() 23*9880d681SAndroid Build Coastguard Worker br i1 %cnd, label %backedge, label %rare, !prof !{!"branch_weights", i32 1000000, i32 1} 24*9880d681SAndroid Build Coastguard Workerrare: 25*9880d681SAndroid Build Coastguard Worker call void @foo() 26*9880d681SAndroid Build Coastguard Worker br label %backedge 27*9880d681SAndroid Build Coastguard Workerbackedge: 28*9880d681SAndroid Build Coastguard Worker call void @foo() 29*9880d681SAndroid Build Coastguard Worker %iv.next = add i32 %iv, 1 30*9880d681SAndroid Build Coastguard Worker %cmp = icmp eq i32 %iv.next, 200 31*9880d681SAndroid Build Coastguard Worker br i1 %cmp, label %loop, label %exit, !prof !{!"branch_weights", i32 1000, i32 1} 32*9880d681SAndroid Build Coastguard Worker 33*9880d681SAndroid Build Coastguard Workerexit: 34*9880d681SAndroid Build Coastguard Worker ret void 35*9880d681SAndroid Build Coastguard Worker 36*9880d681SAndroid Build Coastguard Worker} 37*9880d681SAndroid Build Coastguard Worker 38*9880d681SAndroid Build Coastguard Worker 39*9880d681SAndroid Build Coastguard Workerdeclare void @foo() 40