[PATCH] D98766: [RegAlloc] Fix "ran out of regs" with uses in statepoint

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 17 02:21:21 PDT 2021


skatkov created this revision.
skatkov added reviewers: reames, dantrushin, greened, qcolombet, dsanders.
Herald added subscribers: pengfei, hiraditya.
skatkov requested review of this revision.
Herald added a project: LLVM.

Statepoint instruction is known to have a variable and big number of operands.
It is possible that Register Allocator will split live intervals in the way that all
physical registers are occupied by "zero-length" live intervals which are marked
as not-spillable.
While intervals are marked as not-spillable in the moment of creation when they are
really zero-length it is possible that in future as part of re-materialization there will
need a physical register.
As all physical registers are assigned to not-spillable intervals there is not avaialbe
registers and RA reports an error.

The idea of the fix is avoid marking tiny live intervals where there is a use in statepoint
instruction in var args section. Such interval may be perfectly spilled and folded to
operand of statepoint.


https://reviews.llvm.org/D98766

Files:
  llvm/include/llvm/CodeGen/CalcSpillWeights.h
  llvm/lib/CodeGen/CalcSpillWeights.cpp
  llvm/test/CodeGen/X86/statepoint-ra.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98766.331187.patch
Type: text/x-patch
Size: 9768 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210317/912e0082/attachment.bin>


More information about the llvm-commits mailing list