LLVM
8.0.1
|
Calculate auxiliary information for a virtual register such as its spill weight and allocation hint. More...
#include "llvm/CodeGen/CalcSpillWeights.h"
Public Types | |
using | NormalizingFn = float(*)(float, unsigned, unsigned) |
Public Member Functions | |
VirtRegAuxInfo (MachineFunction &mf, LiveIntervals &lis, VirtRegMap *vrm, const MachineLoopInfo &loops, const MachineBlockFrequencyInfo &mbfi, NormalizingFn norm=normalizeSpillWeight) | |
void | calculateSpillWeightAndHint (LiveInterval &li) |
(re)compute li's spill weight and allocation hint. More... | |
float | futureWeight (LiveInterval &li, SlotIndex start, SlotIndex end) |
Compute future expected spill weight of a split artifact of li that will span between start and end slot indexes. More... | |
float | weightCalcHelper (LiveInterval &li, SlotIndex *start=nullptr, SlotIndex *end=nullptr) |
Helper function for weight calculations. More... | |
Calculate auxiliary information for a virtual register such as its spill weight and allocation hint.
Definition at line 47 of file CalcSpillWeights.h.
using llvm::VirtRegAuxInfo::NormalizingFn = float (*)(float, unsigned, unsigned) |
Definition at line 49 of file CalcSpillWeights.h.
|
inline |
Definition at line 61 of file CalcSpillWeights.h.
References calculateSpillWeightAndHint(), llvm::calculateSpillWeightsAndHints(), llvm::sys::path::end(), futureWeight(), llvm::normalizeSpillWeight(), and weightCalcHelper().
void VirtRegAuxInfo::calculateSpillWeightAndHint | ( | LiveInterval & | li | ) |
(re)compute li's spill weight and allocation hint.
Definition at line 138 of file CalcSpillWeights.cpp.
References llvm::LiveInterval::weight, and weightCalcHelper().
Referenced by llvm::LiveRangeEdit::calculateRegClassAndHint(), llvm::calculateSpillWeightsAndHints(), and VirtRegAuxInfo().
float VirtRegAuxInfo::futureWeight | ( | LiveInterval & | li, |
SlotIndex | start, | ||
SlotIndex | end | ||
) |
Compute future expected spill weight of a split artifact of li that will span between start and end slot indexes.
li | The live interval to be split. |
start | The expected begining of the split artifact. Instructions before start will not affect the weight. |
end | The expected end of the split artifact. Instructions after end will not affect the weight. |
Definition at line 146 of file CalcSpillWeights.cpp.
References weightCalcHelper().
Referenced by VirtRegAuxInfo().
float VirtRegAuxInfo::weightCalcHelper | ( | LiveInterval & | li, |
SlotIndex * | start = nullptr , |
||
SlotIndex * | end = nullptr |
||
) |
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.
li | The live interval for which to compute the weight. |
start | The expected begining 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. |
Definition at line 151 of file CalcSpillWeights.cpp.
References llvm::MachineRegisterInfo::addRegAllocationHint(), assert(), llvm::MachineRegisterInfo::clearSimpleHint(), copyHint(), llvm::SlotIndex::distance(), E, llvm::sys::path::end(), llvm::LiveIntervals::getMBBFromIndex(), llvm::MachineInstr::getParent(), llvm::MachineRegisterInfo::getRegAllocationHint(), llvm::MachineFunction::getRegInfo(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::LiveInterval::getSize(), llvm::LiveIntervals::getSpillWeight(), llvm::MachineFunction::getSubtarget(), I, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::MachineRegisterInfo::isAllocatable(), llvm::MachineInstr::isCopy(), llvm::MachineInstr::isDebugInstr(), llvm::MachineInstr::isIdentityCopy(), llvm::MachineInstr::isImplicitDef(), llvm::LiveRange::isLiveAtIndexes(), llvm::LoopBase< BlockT, LoopT >::isLoopExiting(), llvm::TargetRegisterInfo::isPhysicalRegister(), isRematerializable(), llvm::LiveInterval::isSpillable(), llvm::TargetRegisterInfo::isVirtualRegister(), llvm::LiveRange::isZeroLength(), Loops, llvm::LiveInterval::markNotSpillable(), llvm::operator<(), P, llvm::MachineInstr::readsWritesVirtualRegister(), llvm::LiveInterval::reg, Reg, llvm::MachineRegisterInfo::reg_instr_begin(), llvm::MachineRegisterInfo::reg_instr_end(), and llvm::RISCVFenceField::W.
Referenced by calculateSpillWeightAndHint(), futureWeight(), and VirtRegAuxInfo().