31 lines · plain
1; If there's a call in the loop which dominates the backedge, we 2; don't need a safepoint poll (since the callee must contain a 3; poll test).4;; RUN: opt < %s -passes=place-safepoints -S | FileCheck %s5 6declare void @foo()7 8define void @test1() gc "statepoint-example" {9; CHECK-LABEL: test110 11entry:12; CHECK-LABEL: entry13; CHECK: call void @do_safepoint14 br label %loop15 16loop:17; CHECK-LABEL: loop18; CHECK-NOT: call void @do_safepoint19 call void @foo()20 br label %loop21}22 23; This function is inlined when inserting a poll.24declare void @do_safepoint()25define void @gc.safepoint_poll() {26; CHECK-LABEL: gc.safepoint_poll27entry:28 call void @do_safepoint()29 ret void30}31