class LiveInterval

Declaration

class LiveInterval : public LiveRange { /* full declaration omitted */ };

Description

LiveInterval - This class represents the liveness of a register, or stack slot.

Declared at: llvm/include/llvm/CodeGen/LiveInterval.h:686

Inherits from: LiveRange

Member Variables

private llvm::LiveInterval::SubRange* SubRanges = nullptr
Single linked list of subregister live
private const llvm::Register Reg
ranges.
private float Weight = 0.

Inherited from LiveRange:

public segments
public valnos
public segmentSet

Method Overview

  • public LiveInterval(unsigned int Reg, float Weight)
  • private void appendSubRange(llvm::LiveInterval::SubRange * Range)
  • public void clearSubRanges()
  • public void computeSubRangeUndefs(SmallVectorImpl<llvm::SlotIndex> & Undefs, llvm::LaneBitmask LaneMask, const llvm::MachineRegisterInfo & MRI, const llvm::SlotIndexes & Indexes) const
  • public llvm::LiveInterval::SubRange * createSubRange(llvm::BumpPtrAllocator & Allocator, llvm::LaneBitmask LaneMask)
  • public llvm::LiveInterval::SubRange * createSubRangeFrom(llvm::BumpPtrAllocator & Allocator, llvm::LaneBitmask LaneMask, const llvm::LiveRange & CopyFrom)
  • public void dump() const
  • private void freeSubRange(llvm::LiveInterval::SubRange * S)
  • public unsigned int getSize() const
  • public bool hasSubRanges() const
  • public void incrementWeight(float Inc)
  • public bool isSpillable() const
  • public void markNotSpillable()
  • public void print(llvm::raw_ostream & OS) const
  • public void refineSubRanges(llvm::BumpPtrAllocator & Allocator, llvm::LaneBitmask LaneMask, std::function<void (LiveInterval::SubRange &)> Apply, const llvm::SlotIndexes & Indexes, const llvm::TargetRegisterInfo & TRI, unsigned int ComposeSubRegIdx = 0)
  • public llvm::Register reg() const
  • public void removeEmptySubRanges()
  • public void setWeight(float Value)
  • public llvm::LiveInterval::subrange_iterator subrange_begin()
  • public llvm::LiveInterval::const_subrange_iterator subrange_begin() const
  • public llvm::LiveInterval::subrange_iterator subrange_end()
  • public llvm::LiveInterval::const_subrange_iterator subrange_end() const
  • public iterator_range<llvm::LiveInterval::const_subrange_iterator> subranges() const
  • public iterator_range<llvm::LiveInterval::subrange_iterator> subranges()
  • public void verify(const llvm::MachineRegisterInfo * MRI = nullptr) const
  • public float weight() const
  • public ~LiveInterval()

Inherited from LiveRange:

Methods

LiveInterval(unsigned int Reg, float Weight)

Declared at: llvm/include/llvm/CodeGen/LiveInterval.h:722

Parameters

unsigned int Reg
float Weight

void appendSubRange(
    llvm::LiveInterval::SubRange* Range)

Description

Appends @p Range to SubRanges list.

Declared at: llvm/include/llvm/CodeGen/LiveInterval.h:896

Parameters

llvm::LiveInterval::SubRange* Range

void clearSubRanges()

Description

Removes all subregister liveness information.

Declared at: llvm/include/llvm/CodeGen/LiveInterval.h:808

void computeSubRangeUndefs(
    SmallVectorImpl<llvm::SlotIndex>& Undefs,
    llvm::LaneBitmask LaneMask,
    const llvm::MachineRegisterInfo& MRI,
    const llvm::SlotIndexes& Indexes) const

Description

For a given lane mask @p LaneMask, compute indexes at which the lane is marked undefined by subregister <def ,read-undef> definitions.

Declared at: llvm/include/llvm/CodeGen/LiveInterval.h:826

Parameters

SmallVectorImpl<llvm::SlotIndex>& Undefs
llvm::LaneBitmask LaneMask
const llvm::MachineRegisterInfo& MRI
const llvm::SlotIndexes& Indexes

llvm::LiveInterval::SubRange* createSubRange(
    llvm::BumpPtrAllocator& Allocator,
    llvm::LaneBitmask LaneMask)

Description

Creates a new empty subregister live range. The range is added at the beginning of the subrange list; subrange iterators stay valid.

Declared at: llvm/include/llvm/CodeGen/LiveInterval.h:785

Parameters

llvm::BumpPtrAllocator& Allocator
llvm::LaneBitmask LaneMask

llvm::LiveInterval::SubRange* createSubRangeFrom(
    llvm::BumpPtrAllocator& Allocator,
    llvm::LaneBitmask LaneMask,
    const llvm::LiveRange& CopyFrom)

Description

Like createSubRange() but the new range is filled with a copy of the liveness information in @p CopyFrom.

Declared at: llvm/include/llvm/CodeGen/LiveInterval.h:794

Parameters

llvm::BumpPtrAllocator& Allocator
llvm::LaneBitmask LaneMask
const llvm::LiveRange& CopyFrom

void dump() const

Declared at: llvm/include/llvm/CodeGen/LiveInterval.h:883

void freeSubRange(llvm::LiveInterval::SubRange* S)

Description

Free memory held by SubRange.

Declared at: llvm/include/llvm/CodeGen/LiveInterval.h:902

Parameters

llvm::LiveInterval::SubRange* S

unsigned int getSize() const

Description

getSize - Returns the sum of sizes of all the LiveRange's.

Declared at: llvm/include/llvm/CodeGen/LiveInterval.h:816

bool hasSubRanges() const

Description

Returns true if subregister liveness information is available.

Declared at: llvm/include/llvm/CodeGen/LiveInterval.h:803

void incrementWeight(float Inc)

Declared at: llvm/include/llvm/CodeGen/LiveInterval.h:719

Parameters

float Inc

bool isSpillable() const

Description

isSpillable - Can this interval be spilled?

Declared at: llvm/include/llvm/CodeGen/LiveInterval.h:819

void markNotSpillable()

Description

markNotSpillable - Mark interval as not spillable

Declared at: llvm/include/llvm/CodeGen/LiveInterval.h:822

void print(llvm::raw_ostream& OS) const

Declared at: llvm/include/llvm/CodeGen/LiveInterval.h:882

Parameters

llvm::raw_ostream& OS

void refineSubRanges(
    llvm::BumpPtrAllocator& Allocator,
    llvm::LaneBitmask LaneMask,
    std::function<void(LiveInterval::SubRange&)>
        Apply,
    const llvm::SlotIndexes& Indexes,
    const llvm::TargetRegisterInfo& TRI,
    unsigned int ComposeSubRegIdx = 0)

Description

Refines the subranges to support \p LaneMask. This may only be called for LI.hasSubrange()==true. Subregister ranges are split or created until \p LaneMask can be matched exactly. \p Mod is executed on the matching subranges. Example: Given an interval with subranges with lanemasks L0F00, L00F0 and L000F, refining for mask L0018. Will split the L00F0 lane into L00E0 and L0010 and the L000F lane into L0007 and L0008. The Mod function will be applied to the L0010 and L0008 subranges. \p Indexes and \p TRI are required to clean up the VNIs that don't define the related lane masks after they get shrunk. E.g., when L000F gets split into L0007 and L0008 maybe only a subset of the VNIs that defined L000F defines L0007. The clean up of the VNIs need to look at the actual instructions to decide what is or is not live at a definition point. If the update of the subranges occurs while the IR does not reflect these changes, \p ComposeSubRegIdx can be used to specify how the definition are going to be rewritten. E.g., let say we want to merge: V1.sub1: < 2 x s32> = COPY V2.sub3: < 4 x s32> We do that by choosing a class where sub1: < 2 x s32> and sub3: < 4 x s32> overlap, i.e., by choosing a class where we can find "offset + 1 == 3". Put differently we align V2's sub3 with V1's sub1: V2: sub0 sub1 sub2 sub3 V1: <offset > sub0 sub1 This offset will look like a composed subregidx in the the class: V1.(composed sub2 with sub1): < 4 x s32> = COPY V2.sub3: < 4 x s32> => V1.(composed sub2 with sub1): < 4 x s32> = COPY V2.sub3: < 4 x s32> Now if we didn't rewrite the uses and def of V1, all the checks for V1 need to account for this offset. This happens during coalescing where we update the live-ranges while still having the old IR around because updating the IR on-the-fly would actually clobber some information on how the live-ranges that are being updated look like.

Declared at: llvm/include/llvm/CodeGen/LiveInterval.h:870

Parameters

llvm::BumpPtrAllocator& Allocator
llvm::LaneBitmask LaneMask
std::function<void(LiveInterval::SubRange&)> Apply
const llvm::SlotIndexes& Indexes
const llvm::TargetRegisterInfo& TRI
unsigned int ComposeSubRegIdx = 0

llvm::Register reg() const

Declared at: llvm/include/llvm/CodeGen/LiveInterval.h:717

void removeEmptySubRanges()

Description

Removes all subranges without any segments (subranges without segments are not considered valid and should only exist temporarily).

Declared at: llvm/include/llvm/CodeGen/LiveInterval.h:812

void setWeight(float Value)

Declared at: llvm/include/llvm/CodeGen/LiveInterval.h:720

Parameters

float Value

llvm::LiveInterval::subrange_iterator
subrange_begin()

Declared at: llvm/include/llvm/CodeGen/LiveInterval.h:761

llvm::LiveInterval::const_subrange_iterator
subrange_begin() const

Declared at: llvm/include/llvm/CodeGen/LiveInterval.h:768

llvm::LiveInterval::subrange_iterator
subrange_end()

Declared at: llvm/include/llvm/CodeGen/LiveInterval.h:764

llvm::LiveInterval::const_subrange_iterator
subrange_end() const

Declared at: llvm/include/llvm/CodeGen/LiveInterval.h:771

iterator_range<
    llvm::LiveInterval::const_subrange_iterator>
subranges() const

Declared at: llvm/include/llvm/CodeGen/LiveInterval.h:779

iterator_range<
    llvm::LiveInterval::subrange_iterator>
subranges()

Declared at: llvm/include/llvm/CodeGen/LiveInterval.h:775

void verify(const llvm::MachineRegisterInfo* MRI =
                nullptr) const

Declared at: llvm/include/llvm/CodeGen/LiveInterval.h:891

Parameters

const llvm::MachineRegisterInfo* MRI = nullptr

float weight() const

Declared at: llvm/include/llvm/CodeGen/LiveInterval.h:718

~LiveInterval()

Declared at: llvm/include/llvm/CodeGen/LiveInterval.h:724