brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 8c3c569 Raw
74 lines · plain
1; Test that instrumentaiton works fine for the case of catchswitch stmts.2; RUN: opt < %s -passes=pgo-instr-gen -S | FileCheck %s --check-prefix=GEN3; RUN: llvm-profdata merge %S/Inputs/PR41279_2.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 dso_local void @f() personality ptr @__C_specific_handler {8; USE-LABEL: @f9; USE-SAME: !prof ![[FUNC_ENTRY_COUNT:[0-9]+]]10; USE-DAG: {{![0-9]+}} = !{i32 1, !"ProfileSummary", {{![0-9]+}}}11; USE-DAG: {{![0-9]+}} = !{!"DetailedSummary", {{![0-9]+}}}12; USE-DAG: ![[FUNC_ENTRY_COUNT]] = !{!"function_entry_count", i64 6}13;14; GEN-LABEL: @f15;16; GEN: catch.dispatch:17; GEN-NOT: call void @llvm.instrprof.increment18;19; GEN:  _except1:20; GEN:    call void @llvm.instrprof.increment(ptr @__profn_f, i64 {{[0-9]+}}, i32 3, i32 1)21;22; GEN: __except6:23; GEN:   call void @llvm.instrprof.increment(ptr @__profn_f, i64 {{[0-9]+}}, i32 3, i32 2)24;25; GEN: invoke.cont3:26; GEN:   call void @llvm.instrprof.increment(ptr @__profn_f, i64 1096621589180411894, i32 3, i32 0)27entry:28  %__exception_code = alloca i32, align 429  %__exception_code2 = alloca i32, align 430  invoke void @f() #231          to label %invoke.cont unwind label %catch.dispatch32 33catch.dispatch:34  %0 = catchswitch within none [label %__except] unwind to caller35 36__except:37  %1 = catchpad within %0 [ptr null]38  catchret from %1 to label %__except139 40__except1:41  %2 = call i32 @llvm.eh.exceptioncode(token %1)42  store i32 %2, ptr %__exception_code, align 443  br label %__try.cont744 45invoke.cont:46  br label %__try.cont47 48__try.cont:49  invoke void @f()50          to label %invoke.cont3 unwind label %catch.dispatch451 52catch.dispatch4:53  %3 = catchswitch within none [label %__except5] unwind to caller54 55__except5:56  %4 = catchpad within %3 [ptr null]57  catchret from %4 to label %__except658 59__except6:60  %5 = call i32 @llvm.eh.exceptioncode(token %4)61  store i32 %5, ptr %__exception_code2, align 462  br label %__try.cont763 64__try.cont7:65  ret void66 67invoke.cont3:68  br label %__try.cont769}70 71declare dso_local i32 @__C_specific_handler(...)72 73declare i32 @llvm.eh.exceptioncode(token)74