Index: llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp =================================================================== --- llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp +++ llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp @@ -482,8 +482,9 @@ 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) { + // Conservatively suggest hat any pointer is GC one. + return V->getType()->isPtrOrPtrVectorTy(); }; // Before we actually start lowering (and allocating spill slots for values), 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 @@ -583,13 +583,14 @@ ret i64 %addz } -; Demonstrate address of a function (w/o spilling) +; Demonstrate address of a function (w/ spilling) define void @addr_func() gc "statepoint-example" { ; CHECK-LABEL: addr_func: ; 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: Ltmp14: ; CHECK-NEXT: popq %rax @@ -599,7 +600,7 @@ ret void } -; Demonstrate address of a global (w/o spilling) +; Demonstrate address of a global (w/ spilling) @G = external global i32 define void @addr_global() gc "statepoint-example" { ; CHECK-LABEL: addr_global: @@ -607,6 +608,7 @@ ; CHECK-NEXT: pushq %rax ; CHECK-NEXT: .cfi_def_cfa_offset 16 ; CHECK-NEXT: movq _G@{{.*}}(%rip), %rax +; CHECK-NEXT: movq %rax, (%rsp) ; CHECK-NEXT: callq _bar ; CHECK-NEXT: Ltmp15: ; CHECK-NEXT: popq %rax