|
LLVM 24.0.0git
|
Rematerializes registers across code regions to achieve register pressure targets. More...
#include "Target/AMDGPU/GCNRematStrategy.h"
Public Member Functions | |
| GCNRematStrategy (MachineFunction &MF, MutableArrayRef< RegionBoundaries > Regions, MutableArrayRef< GCNRPTracker::LiveRegSet > LiveIns, MutableArrayRef< GCNRPTracker::LiveRegSet > LiveOuts, LiveIntervals &LIS, const MachineBlockFrequencyInfo &MBFI) | |
Creates a strategy that can rematerialize across Regions whose live-ins LiveIns and live-outs LiveOuts are provided. | |
| void | rematerializeFor (unsigned MaxSGPRs, unsigned MaxVGPRs, bool SpillReduction, BitVector &AffectedRegions, MutableArrayRef< GCNRegPressure > *MaxPressure=nullptr) |
Rematerializes with the goal of reducing the maximum pressure in all Regions to MaxSGPRs SGPRs and MaxVGPRs VGPRs. | |
| void | startRecordingRemats () |
| Starts recording rematerializations for eventual rollback. | |
| void | clearRecordedRemats () |
| Stops recording rematerializations and clears all recorded ones. | |
| void | rollbackRecordedRemats () |
| Rolls back all recorded rematerializations. | |
Rematerializes registers across code regions to achieve register pressure targets.
The strategy updates region boundaries and live-ins/live-outs as it rematerializes. It uses the target independent rematerializers to expose rematerializable registers and perform rematerializations.
The strategy only supports rematerializing registers that meet all of the following constraints.
Definition at line 42 of file GCNRematStrategy.h.
|
inline |
Creates a strategy that can rematerialize across Regions whose live-ins LiveIns and live-outs LiveOuts are provided.
The underlying rematerializer is created and initialized.
Definition at line 50 of file GCNRematStrategy.h.
|
inline |
Stops recording rematerializations and clears all recorded ones.
Definition at line 77 of file GCNRematStrategy.h.
References assert().
| void GCNRematStrategy::rematerializeFor | ( | unsigned | MaxSGPRs, |
| unsigned | MaxVGPRs, | ||
| bool | SpillReduction, | ||
| BitVector & | AffectedRegions, | ||
| MutableArrayRef< GCNRegPressure > * | MaxPressure = nullptr ) |
Rematerializes with the goal of reducing the maximum pressure in all Regions to MaxSGPRs SGPRs and MaxVGPRs VGPRs.
SpillReduction indicates whether that register pressure target allows to reduce spilling, which influences rematerialization decisions. Regions which are rematerialized from/into/over have their corresponding index set in AffectedRegions. When not null, MaxPressure provides initial maximum pressure for all regions and contains updated maximum pressures when the function returns.
Definition at line 239 of file GCNRematStrategy.cpp.
References _, llvm::LaneBitmask::any(), assert(), llvm::dbgs(), DefMI, llvm::enumerate(), llvm::LiveInterval::hasSubRanges(), LLVM_DEBUG, llvm::BitVector::reset(), llvm::reverse(), llvm::BitVector::set_bits(), llvm::ArrayRef< T >::size(), llvm::BitVector::size(), llvm::sort(), llvm::LiveInterval::subranges(), TRI, and UseReg().
| void GCNRematStrategy::rollbackRecordedRemats | ( | ) |
Rolls back all recorded rematerializations.
Definition at line 529 of file GCNRematStrategy.cpp.
References assert().
|
inline |
Starts recording rematerializations for eventual rollback.
Definition at line 71 of file GCNRematStrategy.h.
References assert().