This is an archive of the discontinued LLVM Phabricator instance.

MIR Statepoint refactoring: pass GC pointers in VRegs. Part 3/5.
AbandonedPublic

Authored by dantrushin on May 19 2020, 1:23 AM.

Details

Summary

Change MIR representation of STATEPOINT instruction from explicit
spill/reload of GC pointer arguments around statepoint to simply
assigning them to virtual registers. Then they can be spilled as
necessary. Relocated pointers are represented as STATEPOINT's Def
operands (tied to corresponding derived pointers from GC args list):

rel1,rel2,... = STATEPOINT ..., derived1<tied-def0>, derived2<tied-def1>, ...

This patch implements actual lowering with new statepoint representation.
Due to storage limitation of SDNode, first N base and derived pointers
pairs from GC Args list are assigned to virtual registers (of course,
only those which need relocations for derived pointers).
Upper value of N is bounded by the maximal amount of tied registers
MachineInstr can manage (currently, 15). The rest, if any, is passed
on stack slots, as in the old implementation.

Depends On: D80192

Diff Detail

Event Timeline

dantrushin created this revision.May 19 2020, 1:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 19 2020, 1:23 AM
dantrushin marked an inline comment as done.May 19 2020, 2:25 AM
dantrushin added inline comments.
llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
230

@reames : Philip, is there reason why ISD::UNDEF is not handled just like constants in upstream LLVM?
LLVM spills these UNDEFs and they are eliminated by later passes (if unused).

dantrushin abandoned this revision.Jun 11 2020, 5:15 AM

Abandoned in favor of D81648