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

Inherited from MachineFunctionPass:

Inherited from FunctionPass:

Inherited from Pass:

Methods

SpillPlacement()

Declared at: llvm/lib/CodeGen/SpillPlacement.h:75

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)

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)

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()

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

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()

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()

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)

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()

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()

Declared at: llvm/lib/CodeGen/SpillPlacement.h:76