mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
3f0ca03e94
Summary: This patch teaches the PlaceSafepoints pass about two `CallSite` function attributes: * "statepoint-id": if the string value of this attribute can be parsed as an integer, then it is propagated to the ID parameter of the statepoint created. * "statepoint-num-patch-bytes": if the string value of this attribute can be parsed as an integer, then it is propagated to the `num patch bytes` parameter of the statepoint created. This change intentionally does not assert on a malformed value for these attributes, given that they're not "official" attributes. Reviewers: reames, pgavlin Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9735 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237286 91177308-0d34-0410-b5e6-96231b3b80d8
45 lines
1.3 KiB
LLVM
45 lines
1.3 KiB
LLVM
; RUN: opt -place-safepoints -S < %s | FileCheck %s
|
|
|
|
declare void @f()
|
|
declare i32 @personality_function()
|
|
|
|
define void @test_id() gc "statepoint-example" {
|
|
; CHECK-LABEL: @test_id(
|
|
entry:
|
|
; CHECK-LABEL: entry:
|
|
; CHECK: invoke i32 (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 100, i32 0, void ()* @f
|
|
invoke void @f() "statepoint-id"="100" to label %normal_return unwind label %exceptional_return
|
|
|
|
normal_return:
|
|
ret void
|
|
|
|
exceptional_return:
|
|
%landing_pad4 = landingpad {i8*, i32} personality i32 ()* @personality_function cleanup
|
|
ret void
|
|
}
|
|
|
|
define void @test_num_patch_bytes() gc "statepoint-example" {
|
|
; CHECK-LABEL: @test_num_patch_bytes(
|
|
entry:
|
|
; CHECK-LABEL: entry:
|
|
; CHECK: invoke i32 (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 2882400000, i32 99, void ()* null,
|
|
invoke void @f() "statepoint-num-patch-bytes"="99" to label %normal_return unwind label %exceptional_return
|
|
|
|
normal_return:
|
|
ret void
|
|
|
|
exceptional_return:
|
|
%landing_pad4 = landingpad {i8*, i32} personality i32 ()* @personality_function cleanup
|
|
ret void
|
|
}
|
|
|
|
declare void @do_safepoint()
|
|
define void @gc.safepoint_poll() {
|
|
entry:
|
|
call void @do_safepoint()
|
|
ret void
|
|
}
|
|
|
|
; CHECK-NOT: statepoint-id
|
|
; CHECK-NOT: statepoint-num-patch_bytes
|