class VirtRegAuxInfo
Declaration
class VirtRegAuxInfo { /* full declaration omitted */ };
Description
Calculate auxiliary information for a virtual register such as its spill weight and allocation hint.
Declared at: llvm/include/llvm/CodeGen/CalcSpillWeights.h:45
Member Variables
- private llvm::MachineFunction& MF
- private llvm::LiveIntervals& LIS
- private const llvm::VirtRegMap& VRM
- private const llvm::MachineLoopInfo& Loops
- private const llvm::MachineBlockFrequencyInfo& MBFI
Method Overview
- public VirtRegAuxInfo(llvm::MachineFunction & MF, llvm::LiveIntervals & LIS, const llvm::VirtRegMap & VRM, const llvm::MachineLoopInfo & Loops, const llvm::MachineBlockFrequencyInfo & MBFI)
- public void calculateSpillWeightAndHint(llvm::LiveInterval & LI)
- public void calculateSpillWeightsAndHints()
- public static llvm::Register copyHint(const llvm::MachineInstr * MI, unsigned int Reg, const llvm::TargetRegisterInfo & TRI, const llvm::MachineRegisterInfo & MRI)
- private bool isLiveAtStatepointVarArg(llvm::LiveInterval & LI)
- public static bool isRematerializable(const llvm::LiveInterval & LI, const llvm::LiveIntervals & LIS, const llvm::VirtRegMap & VRM, const llvm::TargetInstrInfo & TII)
- protected virtual float normalize(float UseDefFreq, unsigned int Size, unsigned int NumInstr)
- protected float weightCalcHelper(llvm::LiveInterval & LI, llvm::SlotIndex * Start = nullptr, llvm::SlotIndex * End = nullptr)
- public virtual ~VirtRegAuxInfo()
Methods
¶VirtRegAuxInfo(
llvm::MachineFunction& MF,
llvm::LiveIntervals& LIS,
const llvm::VirtRegMap& VRM,
const llvm::MachineLoopInfo& Loops,
const llvm::MachineBlockFrequencyInfo& MBFI)
VirtRegAuxInfo(
llvm::MachineFunction& MF,
llvm::LiveIntervals& LIS,
const llvm::VirtRegMap& VRM,
const llvm::MachineLoopInfo& Loops,
const llvm::MachineBlockFrequencyInfo& MBFI)
Declared at: llvm/include/llvm/CodeGen/CalcSpillWeights.h:57
Parameters
- llvm::MachineFunction& MF
- llvm::LiveIntervals& LIS
- const llvm::VirtRegMap& VRM
- const llvm::MachineLoopInfo& Loops
- const llvm::MachineBlockFrequencyInfo& MBFI
¶void calculateSpillWeightAndHint(
llvm::LiveInterval& LI)
void calculateSpillWeightAndHint(
llvm::LiveInterval& LI)
Description
(re)compute li's spill weight and allocation hint.
Declared at: llvm/include/llvm/CodeGen/CalcSpillWeights.h:65
Parameters
¶void calculateSpillWeightsAndHints()
void calculateSpillWeightsAndHints()
Description
Compute spill weights and allocation hints for all virtual register live intervals.
Declared at: llvm/include/llvm/CodeGen/CalcSpillWeights.h:69
¶static llvm::Register copyHint(
const llvm::MachineInstr* MI,
unsigned int Reg,
const llvm::TargetRegisterInfo& TRI,
const llvm::MachineRegisterInfo& MRI)
static llvm::Register copyHint(
const llvm::MachineInstr* MI,
unsigned int Reg,
const llvm::TargetRegisterInfo& TRI,
const llvm::MachineRegisterInfo& MRI)
Description
Return the preferred allocation register for reg, given a COPY instruction.
Declared at: llvm/include/llvm/CodeGen/CalcSpillWeights.h:73
Parameters
- const llvm::MachineInstr* MI
- unsigned int Reg
- const llvm::TargetRegisterInfo& TRI
- const llvm::MachineRegisterInfo& MRI
¶bool isLiveAtStatepointVarArg(
llvm::LiveInterval& LI)
bool isLiveAtStatepointVarArg(
llvm::LiveInterval& LI)
Description
Returns true if Reg of live interval LI is used in instruction with many operands like STATEPOINT.
Declared at: llvm/include/llvm/CodeGen/CalcSpillWeights.h:54
Parameters
¶static bool isRematerializable(
const llvm::LiveInterval& LI,
const llvm::LiveIntervals& LIS,
const llvm::VirtRegMap& VRM,
const llvm::TargetInstrInfo& TII)
static bool isRematerializable(
const llvm::LiveInterval& LI,
const llvm::LiveIntervals& LIS,
const llvm::VirtRegMap& VRM,
const llvm::TargetInstrInfo& TII)
Description
Determine if all values in LI are rematerializable.
Declared at: llvm/include/llvm/CodeGen/CalcSpillWeights.h:78
Parameters
- const llvm::LiveInterval& LI
- const llvm::LiveIntervals& LIS
- const llvm::VirtRegMap& VRM
- const llvm::TargetInstrInfo& TII
¶virtual float normalize(float UseDefFreq,
unsigned int Size,
unsigned int NumInstr)
virtual float normalize(float UseDefFreq,
unsigned int Size,
unsigned int NumInstr)
Description
Weight normalization function.
Declared at: llvm/include/llvm/CodeGen/CalcSpillWeights.h:100
Parameters
- float UseDefFreq
- unsigned int Size
- unsigned int NumInstr
¶float weightCalcHelper(
llvm::LiveInterval& LI,
llvm::SlotIndex* Start = nullptr,
llvm::SlotIndex* End = nullptr)
float weightCalcHelper(
llvm::LiveInterval& LI,
llvm::SlotIndex* Start = nullptr,
llvm::SlotIndex* End = nullptr)
Description
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.
Declared at: llvm/include/llvm/CodeGen/CalcSpillWeights.h:96
Parameters
- llvm::LiveInterval& LI
- The live interval for which to compute the weight.
- llvm::SlotIndex* Start = nullptr
- The expected beginning of the split artifact. Instructions before start will not affect the weight. Relevant for weight calculation of future split artifact.
- llvm::SlotIndex* End = nullptr
- 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.
¶virtual ~VirtRegAuxInfo()
virtual ~VirtRegAuxInfo()
Declared at: llvm/include/llvm/CodeGen/CalcSpillWeights.h:62