class SpillPlacement
Declaration
class SpillPlacement : public MachineFunctionPass { /* full declaration omitted */ };
Description
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of passes that operate on the MachineFunction representation. Instead of overriding runOnFunction, subclasses override runOnMachineFunction.
Declared at: llvm/lib/CodeGen/SpillPlacement.h:43
Inherits from: MachineFunctionPass
Member Variables
- public static char ID
Method Overview
- public SpillPlacement()
- public void addConstraints(ArrayRef<llvm::SpillPlacement::BlockConstraint> LiveBlocks)
- public void addLinks(ArrayRef<unsigned int> Links)
- public void addPrefSpill(ArrayRef<unsigned int> Blocks, bool Strong)
- public bool finish()
- public llvm::BlockFrequency getBlockFrequency(unsigned int Number) const
- public ArrayRef<unsigned int> getRecentPositive()
- public void iterate()
- public void prepare(llvm::BitVector & RegBundles)
- public bool scanActiveBundles()
- public ~SpillPlacement()
Inherited from MachineFunctionPass:
- public doInitialization
- protected getAnalysisUsage
- protected getClearedProperties
- protected getRequiredProperties
- protected getSetProperties
- protected runOnMachineFunction
Inherited from FunctionPass:
- public assignPassManager
- public createPrinterPass
- public getPotentialPassManagerType
- public runOnFunction
- protected skipFunction
Inherited from Pass:
- public assignPassManager
- public createPass
- public createPrinterPass
- public doFinalization
- public doInitialization
- public dump
- public dumpPassStructure
- public getAdjustedAnalysisPointer
- public getAnalysis
- public getAnalysis
- public getAnalysisID
- public getAnalysisID
- public getAnalysisIfAvailable
- public getAnalysisUsage
- public getAsImmutablePass
- public getAsPMDataManager
- public getPassID
- public getPassKind
- public getPassName
- public getPotentialPassManagerType
- public getResolver
- public lookupPassInfo
- public lookupPassInfo
- public mustPreserveAnalysisID
- public preparePassManager
- public print
- public releaseMemory
- public setResolver
- public verifyAnalysis
Methods
¶SpillPlacement()
SpillPlacement()
Declared at: llvm/lib/CodeGen/SpillPlacement.h:75
¶void addConstraints(
ArrayRef<
llvm::SpillPlacement::BlockConstraint>
LiveBlocks)
void addConstraints(
ArrayRef<
llvm::SpillPlacement::BlockConstraint>
LiveBlocks)
Description
addConstraints - Add constraints and biases. This method may be called more than once to accumulate constraints.
Declared at: llvm/lib/CodeGen/SpillPlacement.h:113
Parameters
- ArrayRef<llvm::SpillPlacement::BlockConstraint> LiveBlocks
- Constraints for blocks that have the variable live in or live out.
¶void addLinks(ArrayRef<unsigned int> Links)
void addLinks(ArrayRef<unsigned int> Links)
Description
addLinks - Add transparent blocks with the given numbers.
Declared at: llvm/lib/CodeGen/SpillPlacement.h:124
Parameters
- ArrayRef<unsigned int> Links
¶void addPrefSpill(ArrayRef<unsigned int> Blocks,
bool Strong)
void addPrefSpill(ArrayRef<unsigned int> Blocks,
bool Strong)
Description
addPrefSpill - Add PrefSpill constraints to all blocks listed. This is equivalent to calling addConstraint with identical BlockConstraints with Entry = Exit = PrefSpill, and ChangesValue = false.
Declared at: llvm/lib/CodeGen/SpillPlacement.h:121
Parameters
- ArrayRef<unsigned int> Blocks
- Array of block numbers that prefer to spill in and out.
- bool Strong
- When true, double the negative bias for these blocks.
¶bool finish()
bool finish()
Description
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().
Declared at: llvm/lib/CodeGen/SpillPlacement.h:148
Returns
True if a perfect solution was found, allowing the variable to be in a register through all relevant bundles.
¶llvm::BlockFrequency getBlockFrequency(
unsigned int Number) const
llvm::BlockFrequency getBlockFrequency(
unsigned int Number) const
Description
getBlockFrequency - Return the estimated block execution frequency per function invocation.
Declared at: llvm/lib/CodeGen/SpillPlacement.h:152
Parameters
- unsigned int Number
¶ArrayRef<unsigned int> getRecentPositive()
ArrayRef<unsigned int> getRecentPositive()
Description
getRecentPositive - Return an array of bundles that became positive during the previous call to scanActiveBundles or iterate.
Declared at: llvm/lib/CodeGen/SpillPlacement.h:139
¶void iterate()
void iterate()
Description
iterate - Update the network iteratively until convergence, or new bundles are found.
Declared at: llvm/lib/CodeGen/SpillPlacement.h:135
¶void prepare(llvm::BitVector& RegBundles)
void prepare(llvm::BitVector& RegBundles)
Description
prepare - Reset state and prepare for a new spill placement computation.
Declared at: llvm/lib/CodeGen/SpillPlacement.h:107
Parameters
- llvm::BitVector& 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.
¶bool scanActiveBundles()
bool scanActiveBundles()
Description
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.
Declared at: llvm/lib/CodeGen/SpillPlacement.h:131
¶~SpillPlacement()
~SpillPlacement()
Declared at: llvm/lib/CodeGen/SpillPlacement.h:76