llvm-6502/test/Transforms/PlaceSafepoints/call-in-loop.ll
Philip Reames 7a62a2a5ae [PlaceSafepoints] Adjust enablement logic to default to off and be GC configurable per GC
Previously, this pass ran over every function in the Module if added to the pass order.  With this change, it runs only over those with a GC attribute where the GC explicitly opts in.  A GC can also choose which of entry safepoint polls, backedge safepoint polls, and call safepoints it wants.  I hope to get these exposed as checks on the GCStrategy at some point, but for now, the checks are manual string comparisons.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230097 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 00:09:09 +00:00

32 lines
704 B
LLVM

; If there's a call in the loop which dominates the backedge, we
; don't need a safepoint poll (since the callee must contain a
; poll test).
;; RUN: opt %s -place-safepoints -S | FileCheck %s
declare void @foo()
define void @test1() gc "statepoint-example" {
; CHECK-LABEL: test1
entry:
; CHECK-LABEL: entry
; CHECK: statepoint
br label %loop
loop:
; CHECK-LABEL: loop
; CHECK: @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo
; CHECK-NOT: statepoint
call void @foo()
br label %loop
}
; This function is inlined when inserting a poll.
declare void @do_safepoint()
define void @gc.safepoint_poll() {
; CHECK-LABEL: gc.safepoint_poll
entry:
call void @do_safepoint()
ret void
}