• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1;; A very basic test to make sure that splitting the backedge keeps working
2;; RUN: opt < %s -place-safepoints -spp-split-backedge=1 -S | FileCheck %s
3
4define void @test(i32, i1 %cond) gc "statepoint-example" {
5; CHECK-LABEL: @test
6; CHECK-LABEL: loop.loop_crit_edge
7; CHECK: call void @do_safepoint
8; CHECK-NEXT: br label %loop
9entry:
10  br label %loop
11
12loop:
13  br i1 %cond, label %loop, label %exit
14
15exit:
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.
23define void @test2(i32, i1 %cond) gc "statepoint-example" {
24; CHECK-LABEL: @test2
25; CHECK-LABEL: loop2.loop2_crit_edge:
26; CHECK: call void @do_safepoint
27; CHECK-NEXT: br label %loop2
28; CHECK-LABEL: loop2.loop_crit_edge:
29; CHECK: call void @do_safepoint
30; CHECK-NEXT: br label %loop
31entry:
32  br label %loop
33
34loop:
35  br label %loop2
36
37loop2:
38  br i1 %cond, label %loop, label %loop2
39}
40
41declare void @do_safepoint()
42define void @gc.safepoint_poll() {
43entry:
44  call void @do_safepoint()
45  ret void
46}