LLVM 22.0.0git
|
RAII helper class for scavenging or spilling a register. More...
Public Member Functions | |
ScopedScavengeOrSpill (const ScopedScavengeOrSpill &)=delete | |
ScopedScavengeOrSpill (ScopedScavengeOrSpill &&)=delete | |
ScopedScavengeOrSpill (MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, Register SpillCandidate, const TargetRegisterClass &RC, LiveRegUnits const &UsedRegs, BitVector const &AllocatableRegs, std::optional< int > *MaybeSpillFI, Register PreferredReg=AArch64::NoRegister) | |
bool | hasSpilled () const |
Register | freeRegister () const |
Returns the free register (found from scavenging or spilling a register). | |
Register | operator* () const |
~ScopedScavengeOrSpill () |
RAII helper class for scavenging or spilling a register.
On construction attempts to find a free register of class RC
(given UsedRegs
and AllocatableRegs
), if no register can be found spills SpillCandidate
to MaybeSpillFI
to free a register. The free'd register is returned via the FreeReg
output parameter. On destruction, if there is a spill, its previous value is reloaded. The spilling and scavenging is only valid at the insertion point MBBI
, this class should not be used in places that create or manipulate basic blocks, moving the expected insertion point.
Definition at line 3709 of file AArch64FrameLowering.cpp.
|
delete |
References ScopedScavengeOrSpill().
Referenced by ScopedScavengeOrSpill(), and ScopedScavengeOrSpill().
|
delete |
References ScopedScavengeOrSpill().
|
inline |
Definition at line 3713 of file AArch64FrameLowering.cpp.
References assert(), const, llvm::MachineFrameInfo::CreateSpillStackObject(), llvm::MachineFunction::getFrameInfo(), Register, and tryScavengeRegister().
|
inline |
Definition at line 3746 of file AArch64FrameLowering.cpp.
References hasSpilled(), and Register.
|
inline |
Returns the free register (found from scavenging or spilling a register).
Definition at line 3742 of file AArch64FrameLowering.cpp.
Referenced by operator*().
|
inline |
Definition at line 3739 of file AArch64FrameLowering.cpp.
Referenced by expandFillPPRFromZPRSlotPseudo(), and ~ScopedScavengeOrSpill().
|
inline |
Definition at line 3744 of file AArch64FrameLowering.cpp.
References freeRegister().