49 lines · plain
1; RUN: opt < %s -passes=pgo-instr-gen -S | FileCheck %s --check-prefixes=CHECK,GEN2; RUN: opt < %s -passes=pgo-instr-gen,instrprof -S | FileCheck %s --check-prefixes=CHECK,LOWER3 4target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"5target triple = "wasm32-unknown-unknown"6 7define void @wasm_funclet_op_bundle(ptr %p, ptr %dst, ptr %src) personality ptr @__gxx_wasm_personality_v0 {8entry:9 invoke void @foo()10 to label %try.cont unwind label %catch.dispatch11 12catch.dispatch: ; preds = %entry13 %0 = catchswitch within none [label %catch.start] unwind to caller14 15catch.start: ; preds = %catch.dispatch16 %1 = catchpad within %0 [ptr null]17; CHECK: %[[CATCHPAD:.*]] = catchpad18 %2 = call ptr @llvm.wasm.get.exception(token %1)19 %3 = call i32 @llvm.wasm.get.ehselector(token %1)20 %4 = call ptr @__cxa_begin_catch(ptr %2) #3 [ "funclet"(token %1) ]21 %tmp = load i32, ptr %p, align 422 call void @llvm.memcpy.p0.p0.i32(ptr %dst, ptr %src, i32 %tmp, i1 false)23; GEN: call void @llvm.instrprof.value.profile({{.*}}) [ "funclet"(token %[[CATCHPAD]]) ]24; LOWER: call void @__llvm_profile_instrument_memop({{.*}}) [ "funclet"(token %[[CATCHPAD]]) ]25 call void @__cxa_end_catch() [ "funclet"(token %1) ]26 catchret from %1 to label %try.cont27 28try.cont: ; preds = %catch.start, %entry29 ret void30}31 32declare void @foo()33declare i32 @__gxx_wasm_personality_v0(...)34; Function Attrs: nocallback nofree nosync nounwind willreturn35declare ptr @llvm.wasm.get.exception(token) #036; Function Attrs: nocallback nofree nosync nounwind willreturn37declare i32 @llvm.wasm.get.ehselector(token) #038; Function Attrs: nounwind memory(none)39declare i32 @llvm.eh.typeid.for(ptr) #140declare ptr @__cxa_begin_catch(ptr)41declare void @__cxa_end_catch()42; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)43declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #244 45attributes #0 = { nocallback nofree nosync nounwind willreturn }46attributes #1 = { nounwind memory(none) }47attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }48attributes #3 = { nounwind }49