llvm.org GIT mirror llvm / 7b845c1
[Statepoints] Check for the "gc-leaf-function" attribute on call sites as well. Reviewers: sanjoy, reames Subscribers: sanjoy, llvm-commits Differential Revision: http://reviews.llvm.org/D15900 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256875 91177308-0d34-0410-b5e6-96231b3b80d8 Manuel Jacob 3 years ago
2 changed file(s) with 13 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
15521552 return true;
15531553
15541554 // Check if the function is specifically marked as a gc leaf function.
1555 //
1556 // TODO: we should be checking the attributes on the call site as well.
1555 if (CS.hasFnAttr("gc-leaf-function"))
1556 return true;
15571557 if (const Function *F = CS.getCalledFunction())
15581558 return F->hasFnAttribute("gc-leaf-function");
15591559
0 ; RUN: opt %s -S -place-safepoints | FileCheck %s
11
22 declare void @foo() "gc-leaf-function"
3 declare void @bar()
34
45 ; Calls of functions with the "gc-leaf-function" attribute shouldn't be turned
56 ; into a safepoint. An entry safepoint should get inserted, though.
1314 ret void
1415 }
1516
17 define void @test_leaf_function_call() gc "statepoint-example" {
18 ; CHECK-LABEL: test_leaf_function_call
19 ; CHECK: gc.statepoint.p0f_isVoidf
20 ; CHECK-NOT: statepoint
21 ; CHECK-NOT: gc.result
22 entry:
23 call void @bar() "gc-leaf-function"
24 ret void
25 }
26
1627 ; This function is inlined when inserting a poll.
1728 declare void @do_safepoint()
1829 define void @gc.safepoint_poll() {