class LiveRangeUpdater

Declaration

class LiveRangeUpdater { /* full declaration omitted */ };

Description

Helper class for performant LiveRange bulk updates. Calling LiveRange::addSegment() repeatedly can be expensive on large live ranges because segments after the insertion point may need to be shifted. The LiveRangeUpdater class can defer the shifting when adding many segments in order. The LiveRange will be in an invalid state until flush() is called.

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

Member Variables

private llvm::LiveRange* LR
private llvm::SlotIndex LastStart
private LiveRange::iterator WriteI
private LiveRange::iterator ReadI
private SmallVector<LiveRange::Segment, 16> Spills

Method Overview

Methods

LiveRangeUpdater(llvm::LiveRange* lr = nullptr)

Description

Create a LiveRangeUpdater for adding segments to LR. LR will temporarily be in an invalid state until flush() is called.

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

Parameters

llvm::LiveRange* lr = nullptr

void add(LiveRange::Segment)

Description

Add a segment to LR and coalesce when possible, just like LR.addSegment(). Segments should be added in increasing start order for best performance.

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

Parameters

LiveRange::Segment

void add(llvm::SlotIndex Start,
         llvm::SlotIndex End,
         llvm::VNInfo* VNI)

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

Parameters

llvm::SlotIndex Start
llvm::SlotIndex End
llvm::VNInfo* VNI

void dump() const

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

void flush()

Description

Flush the updater state to LR so it is valid and contains all added segments.

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

llvm::LiveRange* getDest() const

Description

Get the current destination live range.

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

bool isDirty() const

Description

Return true if the LR is currently in an invalid state, and flush() needs to be called.

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

void mergeSpills()

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

void print(llvm::raw_ostream&) const

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

Parameters

llvm::raw_ostream&

void setDest(llvm::LiveRange* lr)

Description

Select a different destination live range.

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

Parameters

llvm::LiveRange* lr

~LiveRangeUpdater()

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