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:46

Method Overview

  • public VirtRegAuxInfo(llvm::MachineFunction & mf, llvm::LiveIntervals & lis, llvm::VirtRegMap * vrm, const llvm::MachineLoopInfo & loops, const llvm::MachineBlockFrequencyInfo & mbfi, llvm::VirtRegAuxInfo::NormalizingFn norm = normalizeSpillWeight)
  • public void calculateSpillWeightAndHint(llvm::LiveInterval & li)
  • public float futureWeight(llvm::LiveInterval & li, llvm::SlotIndex start, llvm::SlotIndex end)
  • public float weightCalcHelper(llvm::LiveInterval & li, llvm::SlotIndex * start = nullptr, llvm::SlotIndex * end = nullptr)

Methods

VirtRegAuxInfo(
    llvm::MachineFunction& mf,
    llvm::LiveIntervals& lis,
    llvm::VirtRegMap* vrm,
    const llvm::MachineLoopInfo& loops,
    const llvm::MachineBlockFrequencyInfo& mbfi,
    llvm::VirtRegAuxInfo::NormalizingFn norm =
        normalizeSpillWeight)

Declared at: llvm/include/llvm/CodeGen/CalcSpillWeights.h:60

Parameters

llvm::MachineFunction& mf
llvm::LiveIntervals& lis
llvm::VirtRegMap* vrm
const llvm::MachineLoopInfo& loops
const llvm::MachineBlockFrequencyInfo& mbfi
llvm::VirtRegAuxInfo::NormalizingFn norm = normalizeSpillWeight

void calculateSpillWeightAndHint(
    llvm::LiveInterval& li)

Description

(re)compute li's spill weight and allocation hint.

Declared at: llvm/include/llvm/CodeGen/CalcSpillWeights.h:67

Parameters

llvm::LiveInterval& li

float futureWeight(llvm::LiveInterval& li,
                   llvm::SlotIndex start,
                   llvm::SlotIndex end)

Description

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:78

Parameters

llvm::LiveInterval& li
The live interval to be split.
llvm::SlotIndex start
The expected begining of the split artifact. Instructions before start will not affect the weight.
llvm::SlotIndex end
The expected end of the split artifact. Instructions after end will not affect the weight.

Returns

The expected spill weight of the split artifact. Returns negative weight for unspillable li.

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:92

Parameters

llvm::LiveInterval& li
The live interval for which to compute the weight.
llvm::SlotIndex* start = nullptr
The expected begining 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.