[all-commits] [llvm/llvm-project] 311d81: [RegAlloc] Fix "ran out of regs" with uses in stat...

serguei-katkov via All-commits all-commits at lists.llvm.org
Tue Mar 23 21:01:55 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 311d81ce971ff413fae558ea6b3a8cc9887aa00c
      https://github.com/llvm/llvm-project/commit/311d81ce971ff413fae558ea6b3a8cc9887aa00c
  Author: Serguei Katkov <serguei.katkov at azul.com>
  Date:   2021-03-24 (Wed, 24 Mar 2021)

  Changed paths:
    M llvm/include/llvm/CodeGen/CalcSpillWeights.h
    M llvm/lib/CodeGen/CalcSpillWeights.cpp
    A llvm/test/CodeGen/X86/statepoint-ra.ll

  Log Message:
  -----------
  [RegAlloc] Fix "ran out of regs" with uses in statepoint

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 for physical register between def and use of such tiny interval (the use is not
related to this interval at all).
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.

Reviewers: reames, dantrushin, qcolombet, dsanders, dmgreen
Reviewed By: reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D98766




More information about the All-commits mailing list