1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-26 22:42:46 +02:00
llvm-mirror/test/Transforms/PlaceSafepoints/call-in-loop.ll
Philip Reames fe3f4cccba [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.

llvm-svn: 230097
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
}