llvm.org GIT mirror llvm / b608bbe
[RS4GC] Dont' propagate call attrs related to patchable statepoints The `"statepoint-id"` and `"statepoint-num-patch-bytes"` attributes are used solely to determine properties of the `gc.statepoint` being created. Once the `gc.statepoint` is in place, these should be removed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250491 91177308-0d34-0410-b5e6-96231b3b80d8 Sanjoy Das 4 years ago
2 changed file(s) with 51 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
12891289 Attr.hasAttribute(Attribute::ReadOnly))
12901290 continue;
12911291
1292 // These attributes control the generation of the gc.statepoint call /
1293 // invoke itself; and once the gc.statepoint is in place, they're of no
1294 // use.
1295 if (Attr.hasAttribute("statepoint-num-patch-bytes") ||
1296 Attr.hasAttribute("statepoint-id"))
1297 continue;
1298
12921299 Ret = Ret.addAttributes(
12931300 AS.getContext(), Index,
12941301 AttributeSet::get(AS.getContext(), Index, AttrBuilder(Attr)));
0 ; RUN: opt -S -rewrite-statepoints-for-gc -rs4gc-use-deopt-bundles < %s | FileCheck %s
1
2 declare void @f()
3 declare i32 @personality_function()
4
5 define void @test_id() gc "statepoint-example" personality i32 ()* @personality_function {
6 ; CHECK-LABEL: @test_id(
7 entry:
8 ; CHECK-LABEL: entry:
9 ; CHECK: invoke i32 (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 100, i32 0, void ()* @f
10 invoke void @f() "statepoint-id"="100" to label %normal_return unwind label %exceptional_return
11
12 normal_return:
13 ret void
14
15 exceptional_return:
16 %landing_pad4 = landingpad {i8*, i32} cleanup
17 ret void
18 }
19
20 define void @test_num_patch_bytes() gc "statepoint-example" personality i32 ()* @personality_function {
21 ; CHECK-LABEL: @test_num_patch_bytes(
22 entry:
23 ; CHECK-LABEL: entry:
24 ; CHECK: invoke i32 (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 2882400000, i32 99, void ()* @f,
25 invoke void @f() "statepoint-num-patch-bytes"="99" to label %normal_return unwind label %exceptional_return
26
27 normal_return:
28 ret void
29
30 exceptional_return:
31 %landing_pad4 = landingpad {i8*, i32} cleanup
32 ret void
33 }
34
35 declare void @do_safepoint()
36 define void @gc.safepoint_poll() {
37 entry:
38 call void @do_safepoint()
39 ret void
40 }
41
42 ; CHECK-NOT: statepoint-id
43 ; CHECK-NOT: statepoint-num-patch_bytes