llvm::TargetRegisterInfo::shouldUseLastChanceRecoloringForVirtReg

Decide whether last-chance recoloring should run for VirtReg.

Synopsis

Declared in <llvm/CodeGen/TargetRegisterInfo.h>

virtual
bool
shouldUseLastChanceRecoloringForVirtReg(
    MachineFunction const& MF,
    LiveInterval const& VirtReg) const;

Description

Last chance recoloring has a high compile time cost especially for targets with a lot of registers. This method is used to decide whether or not VirtReg should go through this expensive heuristic. When this target hook is hit, by returning false, there is a high chance that the register allocation will fail altogether (usually with "ran out of registers"). That said, this error usually points to another problem in the optimization pipeline.

Return Value

True if last-chance recoloring should run for VirtReg.

Parameters

NameDescription
MFFunction that owns VirtReg.
VirtRegLive interval being considered for last-chance recoloring.