llvm-6502/test/Transforms/PlaceSafepoints/split-backedge.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

47 lines
1.1 KiB
LLVM

;; A very basic test to make sure that splitting the backedge keeps working
;; RUN: opt -place-safepoints -spp-split-backedge=1 -S %s | FileCheck %s
define void @test(i32, i1 %cond) gc "statepoint-example" {
; CHECK-LABEL: @test
; CHECK-LABEL: loop.loop_crit_edge
; CHECK: gc.statepoint
; CHECK-NEXT: br label %loop
entry:
br label %loop
loop:
br i1 %cond, label %loop, label %exit
exit:
ret void
}
; Test for the case where a single conditional branch jumps to two
; different loop header blocks. Since we're currently using LoopSimplfy
; this doesn't hit the interesting case, but once we remove that, we need
; to be sure this keeps working.
define void @test2(i32, i1 %cond) gc "statepoint-example" {
; CHECK-LABEL: @test2
; CHECK-LABE: loop.loopexit.split
; CHECK: gc.statepoint
; CHECK-NEXT: br label %loop
; CHECK-LABEL: loop2.loop2_crit_edge
; CHECK: gc.statepoint
; CHECK-NEXT: br label %loop2
entry:
br label %loop
loop:
br label %loop2
loop2:
br i1 %cond, label %loop, label %loop2
}
declare void @do_safepoint()
define void @gc.safepoint_poll() {
entry:
call void @do_safepoint()
ret void
}