LLVM API Documentation
#include <SpillPlacement.h>
Classes | |
struct | BlockConstraint |
BlockConstraint - Entry and exit constraints for a basic block. More... | |
struct | Node |
Public Types | |
enum | BorderConstraint { DontCare, PrefReg, PrefSpill, PrefBoth, MustSpill } |
Public Member Functions | |
SpillPlacement () | |
~SpillPlacement () | |
void | prepare (BitVector &RegBundles) |
void | addConstraints (ArrayRef< BlockConstraint > LiveBlocks) |
void | addPrefSpill (ArrayRef< unsigned > Blocks, bool Strong) |
addPrefSpill - Same as addConstraints(PrefSpill) More... | |
void | addLinks (ArrayRef< unsigned > Links) |
addLinks - Add transparent blocks with the given numbers. More... | |
bool | scanActiveBundles () |
void | iterate () |
ArrayRef< unsigned > | getRecentPositive () |
bool | finish () |
BlockFrequency | getBlockFrequency (unsigned Number) const |
![]() | |
FunctionPass (char &pid) | |
Pass * | createPrinterPass (raw_ostream &O, const std::string &Banner) const |
createPrinterPass - Get a function printer pass. More... | |
virtual void | assignPassManager (PMStack &PMS, PassManagerType T) |
virtual PassManagerType | getPotentialPassManagerType () const |
Return what kind of Pass Manager can manage this pass. More... | |
![]() | |
Pass (PassKind K, char &pid) | |
virtual | ~Pass () |
PassKind | getPassKind () const |
virtual const char * | getPassName () const |
AnalysisID | getPassID () const |
getPassID - Return the PassID number that corresponds to this pass. More... | |
virtual bool | doInitialization (Module &) |
virtual bool | doFinalization (Module &) |
virtual void | print (raw_ostream &O, const Module *M) const |
void | dump () const |
virtual void | preparePassManager (PMStack &) |
Check if available pass managers are suitable for this pass or not. More... | |
void | setResolver (AnalysisResolver *AR) |
AnalysisResolver * | getResolver () const |
virtual void * | getAdjustedAnalysisPointer (AnalysisID ID) |
virtual ImmutablePass * | getAsImmutablePass () |
virtual PMDataManager * | getAsPMDataManager () |
virtual void | verifyAnalysis () const |
virtual void | dumpPassStructure (unsigned Offset=0) |
template<typename AnalysisType > | |
AnalysisType * | getAnalysisIfAvailable () const |
bool | mustPreserveAnalysisID (char &AID) const |
template<typename AnalysisType > | |
AnalysisType & | getAnalysis () const |
template<typename AnalysisType > | |
AnalysisType & | getAnalysis (Function &F) |
template<typename AnalysisType > | |
AnalysisType & | getAnalysisID (AnalysisID PI) const |
template<typename AnalysisType > | |
AnalysisType & | getAnalysisID (AnalysisID PI, Function &F) |
Static Public Attributes | |
static char | ID = 0 |
Additional Inherited Members | |
![]() | |
static const PassInfo * | lookupPassInfo (const void *TI) |
static const PassInfo * | lookupPassInfo (StringRef Arg) |
static Pass * | createPass (AnalysisID ID) |
![]() | |
MachineFunctionPass (char &ID) | |
Definition at line 42 of file SpillPlacement.h.
BorderConstraint - A basic block has separate constraints for entry and exit.
Definition at line 71 of file SpillPlacement.h.
|
inline |
Definition at line 66 of file SpillPlacement.h.
|
inline |
Definition at line 67 of file SpillPlacement.h.
void SpillPlacement::addConstraints | ( | ArrayRef< BlockConstraint > | LiveBlocks | ) |
addConstraints - Add constraints and biases. This method may be called more than once to accumulate constraints.
LiveBlocks | Constraints for blocks that have the variable live in or live out. |
addConstraints - Compute node biases and weights from a set of constraints. Set a bit in NodeMask for each active node.
Definition at line 231 of file SpillPlacement.cpp.
References llvm::SpillPlacement::Node::addBias(), llvm::ArrayRef< T >::begin(), DontCare, llvm::ArrayRef< T >::end(), llvm::EdgeBundles::getBundle(), I, and llvm::ARM_AM::ib.
addLinks - Add transparent blocks with the given numbers.
Definition at line 268 of file SpillPlacement.cpp.
References llvm::SpillPlacement::Node::addLink(), llvm::ArrayRef< T >::begin(), llvm::ArrayRef< T >::empty(), llvm::ArrayRef< T >::end(), llvm::EdgeBundles::getBundle(), I, llvm::ARM_AM::ib, llvm::SpillPlacement::Node::mustSpill(), and llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().
addPrefSpill - Same as addConstraints(PrefSpill)
addPrefSpill - Add PrefSpill constraints to all blocks listed. This is equivalent to calling addConstraint with identical BlockConstraints with Entry = Exit = PrefSpill, and ChangesValue = false.
Blocks | Array of block numbers that prefer to spill in and out. |
Strong | When true, double the negative bias for these blocks. |
Definition at line 253 of file SpillPlacement.cpp.
References llvm::SpillPlacement::Node::addBias(), llvm::ArrayRef< T >::begin(), llvm::ArrayRef< T >::end(), llvm::EdgeBundles::getBundle(), I, llvm::ARM_AM::ib, and PrefSpill.
bool SpillPlacement::finish | ( | ) |
finish - Compute the optimal spill code placement given the constraints. No MustSpill constraints will be violated, and the smallest possible number of PrefX constraints will be violated, weighted by expected execution frequencies. The selected bundles are returned in the bitvector passed to prepare().
Definition at line 366 of file SpillPlacement.cpp.
References llvm::BitVector::find_first(), llvm::BitVector::find_next(), and llvm::BitVector::reset().
|
inline |
getBlockFrequency - Return the estimated block execution frequency per function invocation.
Definition at line 143 of file SpillPlacement.h.
getRecentPositive - Return an array of bundles that became positive during the previous call to scanActiveBundles or iterate.
Definition at line 130 of file SpillPlacement.h.
void SpillPlacement::iterate | ( | ) |
iterate - Update the network iteratively until convergence, or new bundles are found.
iterate - Repeatedly update the Hopfield nodes until stability or the maximum number of iterations is reached.
Linked | - Numbers of linked nodes that need updating. |
Definition at line 310 of file SpillPlacement.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorBase::empty(), llvm::SmallVectorTemplateCommon< T, typename >::end(), I, llvm::next(), llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::SmallVectorTemplateCommon< T, typename >::rbegin(), llvm::SmallVectorTemplateCommon< T, typename >::rend(), and llvm::SpillPlacement::Node::update().
void SpillPlacement::prepare | ( | BitVector & | RegBundles | ) |
prepare - Reset state and prepare for a new spill placement computation.
RegBundles | Bit vector to receive the edge bundles where the variable should be kept in a register. Each bit corresponds to an edge bundle, a set bit means the variable should be kept in a register through the bundle. A clear bit means the variable should be spilled. This vector is retained. |
Definition at line 356 of file SpillPlacement.cpp.
References llvm::BitVector::clear(), llvm::SmallVectorImpl< T >::clear(), llvm::EdgeBundles::getNumBundles(), and llvm::BitVector::resize().
bool SpillPlacement::scanActiveBundles | ( | ) |
scanActiveBundles - Perform an initial scan of all bundles activated by addConstraints and addLinks, updating their state. Add all the bundles that now prefer a register to RecentPositive. Prepare internal data structures for iterate. Return true is there are any positive nodes.
Definition at line 290 of file SpillPlacement.cpp.
References llvm::SmallVectorImpl< T >::clear(), llvm::SmallVectorBase::empty(), llvm::BitVector::find_first(), llvm::BitVector::find_next(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), and llvm::SpillPlacement::Node::update().
|
static |
Definition at line 64 of file SpillPlacement.h.