Index: llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp =================================================================== --- llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp +++ llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp @@ -483,9 +483,7 @@ const bool LiveInDeopt = SI.StatepointFlags & (uint64_t)StatepointFlags::DeoptLiveIn; - auto isGCValue =[&](const Value *V) { - return is_contained(SI.Ptrs, V) || is_contained(SI.Bases, V); - }; + auto isGCValue = [&](const Value *V) { return is_contained(SI.GCArgs, V); }; // Before we actually start lowering (and allocating spill slots for values), // reserve any stack slots which we judge to be profitable to reuse for a Index: llvm/test/CodeGen/X86/statepoint-live-in.ll =================================================================== --- llvm/test/CodeGen/X86/statepoint-live-in.ll +++ llvm/test/CodeGen/X86/statepoint-live-in.ll @@ -633,6 +633,22 @@ ret void } +; Demonstrate address of a function (w/ spilling due to it is gc value) +define void @addr_func2() gc "statepoint-example" { +; CHECK-LABEL: addr_func2: +; CHECK: ## %bb.0: ## %entry +; CHECK-NEXT: pushq %rax +; CHECK-NEXT: .cfi_def_cfa_offset 16 +; CHECK-NEXT: movq _bar@{{.*}}(%rip), %rax +; CHECK-NEXT: movq %rax, (%rsp) +; CHECK-NEXT: callq _bar +; CHECK-NEXT: Ltmp17: +; CHECK-NEXT: popq %rax +; CHECK-NEXT: retq +entry: + %statepoint_token1 = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 2882400000, i32 0, void ()* @bar, i32 0, i32 2, i64 0, i64 2, void ()* @bar, void ()* @bar, void ()* @bar) + ret void +} ; CHECK: Ltmp0-_test1 ; CHECK: .byte 1