|
LLVM 23.0.0git
|
Models a register pressure target, allowing to evaluate and track register savings against that target from a starting GCNRegPressure. More...
#include "Target/AMDGPU/GCNRegPressure.h"
Public Member Functions | |
| GCNRPTarget (const MachineFunction &MF, const GCNRegPressure &RP) | |
Sets up the target such that the register pressure starting at RP does not show register spilling on function MF (w.r.t. | |
| GCNRPTarget (unsigned NumSGPRs, unsigned NumVGPRs, const MachineFunction &MF, const GCNRegPressure &RP) | |
Sets up the target such that the register pressure starting at RP does not use more than NumSGPRs SGPRs and NumVGPRs VGPRs on function MF. | |
| GCNRPTarget (unsigned Occupancy, const MachineFunction &MF, const GCNRegPressure &RP) | |
Sets up the target such that the register pressure starting at RP does not prevent achieving an occupancy of at least Occupancy on function MF. | |
| void | setTarget (unsigned NumSGPRs, unsigned NumVGPRs) |
| Changes the target (same semantics as constructor). | |
| const GCNRegPressure & | getCurrentRP () const |
| void | setRP (const GCNRegPressure &NewRP) |
| bool | isSaveBeneficial (Register Reg) const |
Determines whether saving virtual register Reg will be beneficial towards achieving the RP target. | |
| void | saveReg (Register Reg, LaneBitmask Mask, const MachineRegisterInfo &MRI) |
Saves virtual register Reg with lanemask Mask. | |
| unsigned | getNumRegsBenefit (const GCNRegPressure &SaveRP) const |
Returns the benefit towards achieving the RP target that saving SaveRP represents, in total number of registers saved across all classes. | |
| void | saveRP (const GCNRegPressure &SaveRP) |
Saves a total pressure of SaveRP. | |
| bool | satisfied (const GCNRegPressure &TestRP) const |
Whether TestRP is at or below the defined pressure target. | |
| bool | satisfied () const |
| Whether the current RP is at or below the defined pressure target. | |
| bool | hasVectorRegisterExcess () const |
| unsigned | getMaxSGPRs () const |
| unsigned | getMaxVGPRs () const |
Friends | |
| raw_ostream & | operator<< (raw_ostream &OS, const GCNRPTarget &Target) |
Models a register pressure target, allowing to evaluate and track register savings against that target from a starting GCNRegPressure.
Definition at line 223 of file GCNRegPressure.h.
| GCNRPTarget::GCNRPTarget | ( | const MachineFunction & | MF, |
| const GCNRegPressure & | RP ) |
Sets up the target such that the register pressure starting at RP does not show register spilling on function MF (w.r.t.
the function's mininum target occupancy).
Definition at line 373 of file GCNRegPressure.cpp.
References F, GCNRPTarget(), and setTarget().
Referenced by GCNRPTarget(), GCNRPTarget(), GCNRPTarget(), and operator<<.
| GCNRPTarget::GCNRPTarget | ( | unsigned | NumSGPRs, |
| unsigned | NumVGPRs, | ||
| const MachineFunction & | MF, | ||
| const GCNRegPressure & | RP ) |
Sets up the target such that the register pressure starting at RP does not use more than NumSGPRs SGPRs and NumVGPRs VGPRs on function MF.
Definition at line 380 of file GCNRegPressure.cpp.
References GCNRPTarget(), and setTarget().
| GCNRPTarget::GCNRPTarget | ( | unsigned | Occupancy, |
| const MachineFunction & | MF, | ||
| const GCNRegPressure & | RP ) |
Sets up the target such that the register pressure starting at RP does not prevent achieving an occupancy of at least Occupancy on function MF.
Definition at line 386 of file GCNRegPressure.cpp.
References GCNRPTarget(), llvm::SIMachineFunctionInfo::getDynamicVGPRBlockSize(), and setTarget().
|
inline |
Definition at line 245 of file GCNRegPressure.h.
|
inline |
Definition at line 274 of file GCNRegPressure.h.
|
inline |
Definition at line 275 of file GCNRegPressure.h.
| unsigned GCNRPTarget::getNumRegsBenefit | ( | const GCNRegPressure & | SaveRP | ) | const |
Returns the benefit towards achieving the RP target that saving SaveRP represents, in total number of registers saved across all classes.
Definition at line 427 of file GCNRegPressure.cpp.
References llvm::GCNRegPressure::getAGPRNum(), llvm::GCNRegPressure::getArchVGPRNum(), and llvm::GCNRegPressure::getSGPRNum().
| bool GCNRPTarget::hasVectorRegisterExcess | ( | ) | const |
Definition at line 459 of file GCNRegPressure.cpp.
Determines whether saving virtual register Reg will be beneficial towards achieving the RP target.
Definition at line 410 of file GCNRegPressure.cpp.
References llvm::SIRegisterInfo::isAGPRClass(), llvm::SIRegisterInfo::isSGPRClass(), MRI, and TRI.
|
inline |
Whether the current RP is at or below the defined pressure target.
Definition at line 271 of file GCNRegPressure.h.
References satisfied().
Referenced by satisfied().
| bool GCNRPTarget::satisfied | ( | const GCNRegPressure & | TestRP | ) | const |
Whether TestRP is at or below the defined pressure target.
Definition at line 451 of file GCNRegPressure.cpp.
References llvm::GCNRegPressure::getSGPRNum(), and llvm::GCNRegPressure::getVGPRNum().
|
inline |
Saves virtual register Reg with lanemask Mask.
Definition at line 254 of file GCNRegPressure.h.
References llvm::LaneBitmask::getNone(), MRI, and Reg.
|
inline |
Saves a total pressure of SaveRP.
Definition at line 263 of file GCNRegPressure.h.
References assert().
|
inline |
Definition at line 247 of file GCNRegPressure.h.
Changes the target (same semantics as constructor).
Definition at line 396 of file GCNRegPressure.cpp.
Referenced by GCNRPTarget(), GCNRPTarget(), and GCNRPTarget().
|
friend |
Definition at line 280 of file GCNRegPressure.h.
References GCNRPTarget().