30 lines · plain
1; RUN: opt -passes=pgo-instr-gen -S 2>&1 < %s | FileCheck %s2;3; RUN: llvm-profdata merge %S/Inputs/callbr.proftext -o %t.profdata4; RUN: opt < %s -passes=pgo-instr-use -pgo-test-profile-file=%t.profdata -S | FileCheck %s --check-prefix=USE5 6 7define i32 @a() {8entry:9; CHECK-NOT: ptrtoint ptr asm sideeffect10; CHECK: callbr void asm sideeffect11 %retval = alloca i32, align 412 callbr void asm sideeffect "", "!i,~{dirflag},~{fpsr},~{flags}"() #113 to label %asm.fallthrough [label %b]14 15asm.fallthrough:16 br label %b17 18b:19 %0 = load i32, ptr %retval, align 420 ret i32 %021}22; USE-LABEL: @a23; USE-SAME: !prof ![[BW_ENTRY:[0-9]+]]24; USE: callbr void asm sideeffect25; USE: to label26; USE-SAME: !prof ![[BW_CALLBR:[0-9]+]]27; USE ![[BW_ENTRY]] = !{!"function_entry_count", i64 100}28; USE ![[BW_CALLBR]] = !{!"branch_weights", i32 80, i32 20}29 30