view test/Transforms/PlaceSafepoints/call-in-loop.ll @ 100:7d135dc70f03 LLVM 3.9

LLVM 3.9
author Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
date Tue, 26 Jan 2016 22:53:40 +0900
parents afa8332a0e37
children 1172e4bd9c6f
line wrap: on
line source

; 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(i64 2882400000, i32 0, 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
}