LLVM
8.0.1
|
Helper class for performant LiveRange bulk updates. More...
#include "llvm/CodeGen/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... | |
LiveRange * | getDest () const |
Get the current destination live range. More... | |
void | dump () const |
void | print (raw_ostream &) const |
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 854 of file LiveInterval.h.
|
inline |
Create a LiveRangeUpdater for adding segments to LR.
LR will temporarily be in an invalid state until flush() is called.
Definition at line 865 of file LiveInterval.h.
|
inline |
Definition at line 867 of file LiveInterval.h.
References llvm::ARM_AM::add.
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 1123 of file LiveInterval.cpp.
References assert(), llvm::LiveRange::begin(), coalescable(), E, llvm::sys::path::end(), llvm::LiveRange::Segment::end, llvm::LiveRange::end(), llvm::LiveRange::find(), llvm::max(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::LiveRange::segments, llvm::LiveRange::segmentSet, llvm::LiveRange::Segment::start, and llvm::LiveRange::Segment::valno.
Referenced by llvm::LiveRange::join(), llvm::LiveRange::MergeSegmentsInAsValue(), and llvm::LiveRange::MergeValueInAsValue().
Definition at line 874 of file LiveInterval.h.
LLVM_DUMP_METHOD void LiveRangeUpdater::dump | ( | ) | const |
Definition at line 1106 of file LiveInterval.cpp.
References llvm::errs(), and print().
void LiveRangeUpdater::flush | ( | ) |
Flush the updater state to LR so it is valid and contains all added segments.
Definition at line 1230 of file LiveInterval.cpp.
References assert(), llvm::LiveRange::begin(), llvm::SmallVectorImpl< T >::erase(), llvm::SmallVectorImpl< T >::insert(), llvm::LiveRange::segments, and llvm::LiveRange::verify().
|
inline |
Get the current destination live range.
Definition at line 894 of file LiveInterval.h.
References llvm::dump(), and print().
|
inline |
Return true if the LR is currently in an invalid state, and flush() needs to be called.
Definition at line 880 of file LiveInterval.h.
References llvm::SlotIndex::isValid().
void LiveRangeUpdater::print | ( | raw_ostream & | OS | ) | const |
Definition at line 1083 of file LiveInterval.cpp.
References assert(), llvm::LiveRange::begin(), E, llvm::LiveRange::end(), I, and llvm::make_range().
Referenced by llvm::operator<<().
|
inline |
Select a different destination live range.
Definition at line 887 of file LiveInterval.h.