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

Inherits from: LiveRange

Member Variables

public const unsigned int reg
ranges.
public float weight

Inherited from LiveRange:

public segments
public valnos
public segmentSet

Method Overview

  • public LiveInterval(unsigned int Reg, float Weight)
  • 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
  • public unsigned int getSize() const
  • public bool hasSubRanges() const
  • 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 void removeEmptySubRanges()
  • public llvm::LiveInterval::const_subrange_iterator subrange_begin() const
  • public llvm::LiveInterval::subrange_iterator subrange_begin()
  • public llvm::LiveInterval::const_subrange_iterator subrange_end() const
  • public llvm::LiveInterval::subrange_iterator subrange_end()
  • public iterator_range<llvm::LiveInterval::subrange_iterator> subranges()
  • public iterator_range<llvm::LiveInterval::const_subrange_iterator> subranges() const
  • public void verify(const llvm::MachineRegisterInfo * MRI = nullptr) const
  • public ~LiveInterval()

Inherited from LiveRange:

Methods

LiveInterval(unsigned int Reg, float Weight)

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

Parameters

unsigned int Reg
float Weight

void clearSubRanges()

Description

Removes all subregister liveness information.

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

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

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

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

Parameters

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

void dump() const

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

unsigned int getSize() const

Description

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

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

bool hasSubRanges() const

Description

Returns true if subregister liveness information is available.

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

bool isSpillable() const

Description

isSpillable - Can this interval be spilled?

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

void markNotSpillable()

Description

markNotSpillable - Mark interval as not spillable

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

void print(llvm::raw_ostream& OS) const

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

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 defne 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:863

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

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

llvm::LiveInterval::const_subrange_iterator
subrange_begin() const

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

llvm::LiveInterval::subrange_iterator
subrange_begin()

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

llvm::LiveInterval::const_subrange_iterator
subrange_end() const

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

llvm::LiveInterval::subrange_iterator
subrange_end()

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

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

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

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

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

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

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

Parameters

const llvm::MachineRegisterInfo* MRI = nullptr

~LiveInterval()

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