1; RUN: opt < %s -S -place-safepoints | FileCheck %s 2 3declare void @llvm.localescape(...) 4 5; Do we insert the entry safepoint after the localescape intrinsic? 6define void @parent() gc "statepoint-example" { 7; CHECK-LABEL: @parent 8entry: 9; CHECK-LABEL: entry 10; CHECK-NEXT: alloca 11; CHECK-NEXT: localescape 12; CHECK-NEXT: call void @do_safepoint 13 %ptr = alloca i32 14 call void (...) @llvm.localescape(i32* %ptr) 15 ret void 16} 17 18; This function is inlined when inserting a poll. To avoid recursive 19; issues, make sure we don't place safepoints in it. 20declare void @do_safepoint() 21define void @gc.safepoint_poll() { 22; CHECK-LABEL: gc.safepoint_poll 23; CHECK-LABEL: entry 24; CHECK-NEXT: do_safepoint 25; CHECK-NEXT: ret void 26entry: 27 call void @do_safepoint() 28 ret void 29}