LLVM: llvm::VirtRegAuxInfo Class Reference (original) (raw)
Calculate auxiliary information for a virtual register such as its spill weight and allocation hint. More...
#include "[llvm/CodeGen/CalcSpillWeights.h](CalcSpillWeights%5F8h%5Fsource.html)"
| Public Member Functions | |
|---|---|
| VirtRegAuxInfo (MachineFunction &MF, LiveIntervals &LIS, const VirtRegMap &VRM, const MachineLoopInfo &Loops, const MachineBlockFrequencyInfo &MBFI, ProfileSummaryInfo *PSI=nullptr) | |
| virtual | ~VirtRegAuxInfo ()=default |
| void | calculateSpillWeightAndHint (LiveInterval &LI) |
| (re)compute li's spill weight and allocation hint. | |
| void | calculateSpillWeightsAndHints () |
| Compute spill weights and allocation hints for all virtual register live intervals. |
| Static Public Member Functions | |
|---|---|
| static Register | copyHint (const MachineInstr *MI, Register Reg, const TargetRegisterInfo &TRI, const MachineRegisterInfo &MRI) |
| Return the preferred allocation register for reg, given a COPY instruction. | |
| static bool | isRematerializable (const LiveInterval &LI, const LiveIntervals &LIS, const VirtRegMap &VRM, const MachineRegisterInfo &MRI, const TargetInstrInfo &TII) |
| Determine if all values in LI are rematerializable. | |
| static bool | allUsesAvailableAt (const MachineInstr *MI, SlotIndex UseIdx, const LiveIntervals &LIS, const MachineRegisterInfo &MRI, const TargetInstrInfo &TII) |
Calculate auxiliary information for a virtual register such as its spill weight and allocation hint.
Definition at line 46 of file CalcSpillWeights.h.
◆ ~VirtRegAuxInfo()
| virtual llvm::VirtRegAuxInfo::~VirtRegAuxInfo ( ) | virtualdefault |
|---|
◆ allUsesAvailableAt()
Returns
true if all registers used by MI are also available with the same value at UseIdx.
Definition at line 149 of file CalcSpillWeights.cpp.
References llvm::SlotIndex::getRegSlot(), llvm::LiveRange::getVNInfoAt(), llvm::LiveInterval::hasSubRanges(), llvm::SlotIndex::isSameInstr(), MI, MRI, llvm::LaneBitmask::none(), llvm::LiveInterval::subranges(), SubReg, TII, and TRI.
Referenced by llvm::LiveRangeEdit::canRematerializeAt(), and isRematerializable().
◆ calculateSpillWeightAndHint()
| void VirtRegAuxInfo::calculateSpillWeightAndHint | ( | LiveInterval & | LI | ) |
|---|
◆ calculateSpillWeightsAndHints()
| void VirtRegAuxInfo::calculateSpillWeightsAndHints | ( | ) |
|---|
◆ copyHint()
◆ isRematerializable()
Determine if all values in LI are rematerializable.
Definition at line 81 of file CalcSpillWeights.cpp.
References allUsesAvailableAt(), assert(), llvm::VNInfo::def, llvm::LiveRange::getVNInfoAt(), I, llvm::VNInfo::id, llvm::VNInfo::isPHIDef(), llvm::VNInfo::isUnused(), MI, MRI, llvm::LiveRange::Query(), llvm::LiveInterval::reg(), TII, llvm::LiveQueryResult::valueIn(), llvm::LiveRange::vni_begin(), and llvm::LiveRange::vni_end().
Referenced by weightCalcHelper().
◆ normalize()
| virtual float llvm::VirtRegAuxInfo::normalize ( float UseDefFreq, unsigned Size, unsigned NumInstr ) | inlineprotectedvirtual |
|---|
◆ weightCalcHelper()
Helper function for weight calculations.
(Re)compute LI's spill weight and allocation hint, or, for non null start and end - compute future expected spill weight of a split artifact of LI that will span between start and end slot indexes.
Parameters
| LI | The live interval for which to compute the weight. |
|---|---|
| Start | The expected beginning of the split artifact. Instructions before start will not affect the weight. Relevant for weight calculation of future split artifact. |
| End | The expected end of the split artifact. Instructions after end will not affect the weight. Relevant for weight calculation of future split artifact. |
Returns
The spill weight. Returns negative weight for unspillable LI.
Definition at line 232 of file CalcSpillWeights.cpp.
References _, assert(), canMemFoldInlineAsm(), copyHint(), llvm::SmallVectorImpl< T >::emplace_back(), llvm::MachineOperand::getReg(), llvm::LiveInterval::getSize(), llvm::LiveIntervals::getSpillWeight(), llvm::MachineOperand::getSubReg(), I, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::LiveRange::isLiveAtIndexes(), llvm::LoopBase< BlockT, LoopT >::isLoopExiting(), isRematerializable(), llvm::LiveInterval::isSpillable(), llvm::Register::isVirtual(), llvm::LiveRange::isZeroLength(), llvm::LiveInterval::markNotSpillable(), MBB, MI, MRI, normalize(), llvm::operator<(), Reg, llvm::LiveInterval::reg(), Register, llvm::sort(), TII, and TRI.
Referenced by calculateSpillWeightAndHint().
The documentation for this class was generated from the following files:
- include/llvm/CodeGen/CalcSpillWeights.h
- lib/CodeGen/CalcSpillWeights.cpp