LLVM  4.0.0
Public Member Functions | List of all members
llvm::LiveRangeUpdater Class Reference

Helper class for performant LiveRange bulk updates. More...

#include <LiveInterval.h>

Public Member Functions

 LiveRangeUpdater (LiveRange *lr=nullptr)
 Create a LiveRangeUpdater for adding segments to LR. More...
 
 ~LiveRangeUpdater ()
 
void add (LiveRange::Segment)
 Add a segment to LR and coalesce when possible, just like LR.addSegment(). More...
 
void add (SlotIndex Start, SlotIndex End, VNInfo *VNI)
 
bool isDirty () const
 Return true if the LR is currently in an invalid state, and flush() needs to be called. More...
 
void flush ()
 Flush the updater state to LR so it is valid and contains all added segments. More...
 
void setDest (LiveRange *lr)
 Select a different destination live range. More...
 
LiveRangegetDest () const
 Get the current destination live range. More...
 
void dump () const
 
void print (raw_ostream &) const
 

Detailed 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.

Definition at line 828 of file LiveInterval.h.

Constructor & Destructor Documentation

llvm::LiveRangeUpdater::LiveRangeUpdater ( LiveRange lr = nullptr)
inline

Create a LiveRangeUpdater for adding segments to LR.

LR will temporarily be in an invalid state until flush() is called.

Definition at line 839 of file LiveInterval.h.

llvm::LiveRangeUpdater::~LiveRangeUpdater ( )
inline

Definition at line 841 of file LiveInterval.h.

References flush().

Member Function Documentation

void LiveRangeUpdater::add ( LiveRange::Segment  Seg)

Add a segment to LR and coalesce when possible, just like LR.addSegment().

Segments should be added in increasing start order for best performance.

Definition at line 1074 of file LiveInterval.cpp.

References assert(), coalescable(), E, llvm::LiveRange::Segment::end, llvm::LiveRange::end(), llvm::LiveRange::Segment::start, and llvm::LiveRange::Segment::valno.

Referenced by add(), llvm::LiveRange::join(), llvm::LiveRange::MergeSegmentsInAsValue(), and llvm::LiveRange::MergeValueInAsValue().

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

Definition at line 848 of file LiveInterval.h.

References add().

LLVM_DUMP_METHOD void LiveRangeUpdater::dump ( ) const

Definition at line 1058 of file LiveInterval.cpp.

References llvm::errs(), and llvm::LiveRange::print().

void LiveRangeUpdater::flush ( )

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

Definition at line 1181 of file LiveInterval.cpp.

References assert().

Referenced by setDest(), and ~LiveRangeUpdater().

LiveRange* llvm::LiveRangeUpdater::getDest ( ) const
inline

Get the current destination live range.

Definition at line 868 of file LiveInterval.h.

bool llvm::LiveRangeUpdater::isDirty ( ) const
inline

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

Definition at line 854 of file LiveInterval.h.

References llvm::SlotIndex::isValid().

Referenced by setDest().

void LiveRangeUpdater::print ( raw_ostream OS) const

Definition at line 1035 of file LiveInterval.cpp.

References assert(), E, I, and llvm::make_range().

Referenced by llvm::operator<<().

void llvm::LiveRangeUpdater::setDest ( LiveRange lr)
inline

Select a different destination live range.

Definition at line 861 of file LiveInterval.h.

References flush(), and isDirty().


The documentation for this class was generated from the following files: