1 ;; A very basic test to make sure that splitting the backedge keeps working 2 ;; RUN: opt -place-safepoints -spp-split-backedge=1 -S %s | FileCheck %s 3 4 define void @test(i32, i1 %cond) gc "statepoint-example" { 5 ; CHECK-LABEL: @test 6 ; CHECK-LABEL: loop.loop_crit_edge 7 ; CHECK: gc.statepoint 8 ; CHECK-NEXT: br label %loop 9 entry: 10 br label %loop 11 12 loop: 13 br i1 %cond, label %loop, label %exit 14 15 exit: 16 ret void 17 } 18 19 ; Test for the case where a single conditional branch jumps to two 20 ; different loop header blocks. Since we're currently using LoopSimplfy 21 ; this doesn't hit the interesting case, but once we remove that, we need 22 ; to be sure this keeps working. 23 define void @test2(i32, i1 %cond) gc "statepoint-example" { 24 ; CHECK-LABEL: @test2 25 ; CHECK-LABEL: loop2.loop2_crit_edge: 26 ; CHECK: gc.statepoint 27 ; CHECK-NEXT: br label %loop2 28 ; CHECK-LABEL: loop2.loop_crit_edge: 29 ; CHECK: gc.statepoint 30 ; CHECK-NEXT: br label %loop 31 entry: 32 br label %loop 33 34 loop: 35 br label %loop2 36 37 loop2: 38 br i1 %cond, label %loop, label %loop2 39 } 40 41 declare void @do_safepoint() 42 define void @gc.safepoint_poll() { 43 entry: 44 call void @do_safepoint() 45 ret void 46 }