LLVM API Documentation
Public Types | |
typedef SmallVector< std::pair < BlockFrequency, unsigned >, 4 > | LinkVector |
Public Member Functions | |
bool | preferReg () const |
preferReg - Return true when this node prefers to be in a register. | |
bool | mustSpill () const |
mustSpill - Return True if this node is so biased that it must spill. | |
void | clear () |
clear - Reset per-query data, but preserve frequencies that only depend on | |
void | addLink (unsigned b, BlockFrequency w) |
addLink - Add a link to bundle b with weight w. | |
void | addBias (BlockFrequency freq, BorderConstraint direction) |
addBias - Bias this node. | |
bool | update (const Node nodes[]) |
Public Attributes | |
BlockFrequency | BiasP |
BiasP - Sum of blocks that prefer a register. | |
int | Value |
LinkVector | Links |
BlockFrequency | SumLinkWeights |
SumLinkWeights - Cached sum of the weights of all links + ThresHold. | |
Static Public Attributes | |
BlockFrequency | BiasN |
BiasN - Sum of blocks that prefer a spill. |
Node - Each edge bundle corresponds to a Hopfield node.
The node contains precomputed frequency data that only depends on the CFG, but Bias and Links are computed each time placeSpills is called.
The node Value is positive when the variable should be in a register. The value can change when linked nodes change, but convergence is very fast because all weights are positive.
Definition at line 93 of file SpillPlacement.cpp.
typedef SmallVector<std::pair<BlockFrequency, unsigned>, 4> llvm::SpillPlacement::Node::LinkVector |
Definition at line 104 of file SpillPlacement.cpp.
void llvm::SpillPlacement::Node::addBias | ( | BlockFrequency | freq, |
BorderConstraint | direction | ||
) | [inline] |
addBias - Bias this node.
Definition at line 151 of file SpillPlacement.cpp.
References llvm::SpillPlacement::Node::BiasN, llvm::SpillPlacement::Node::BiasP, freq, llvm::BlockFrequency::getMaxFrequency(), llvm::SpillPlacement::MustSpill, llvm::SpillPlacement::PrefReg, and llvm::SpillPlacement::PrefSpill.
Referenced by llvm::SpillPlacement::addConstraints(), and llvm::SpillPlacement::addPrefSpill().
void llvm::SpillPlacement::Node::addLink | ( | unsigned | b, |
BlockFrequency | w | ||
) | [inline] |
addLink - Add a link to bundle b with weight w.
Definition at line 136 of file SpillPlacement.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), I, llvm::SpillPlacement::Node::Links, llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), and llvm::SpillPlacement::Node::SumLinkWeights.
Referenced by llvm::SpillPlacement::addLinks().
void llvm::SpillPlacement::Node::clear | ( | ) | [inline] |
clear - Reset per-query data, but preserve frequencies that only depend on
Definition at line 129 of file SpillPlacement.cpp.
References llvm::SpillPlacement::Node::BiasN, llvm::SpillPlacement::Node::BiasP, llvm::SmallVectorImpl< T >::clear(), getThreshold(), llvm::SpillPlacement::Node::Links, and llvm::SpillPlacement::Node::SumLinkWeights.
bool llvm::SpillPlacement::Node::mustSpill | ( | ) | const [inline] |
mustSpill - Return True if this node is so biased that it must spill.
Definition at line 120 of file SpillPlacement.cpp.
References llvm::SpillPlacement::Node::BiasN, llvm::SpillPlacement::Node::BiasP, and llvm::SpillPlacement::Node::SumLinkWeights.
Referenced by llvm::SpillPlacement::addLinks().
bool llvm::SpillPlacement::Node::preferReg | ( | ) | const [inline] |
preferReg - Return true when this node prefers to be in a register.
Definition at line 114 of file SpillPlacement.cpp.
Referenced by llvm::SpillPlacement::Node::update().
bool llvm::SpillPlacement::Node::update | ( | const Node | nodes[] | ) | [inline] |
update - Recompute Value from Bias and Links. Return true when node preference changes.
Definition at line 169 of file SpillPlacement.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SpillPlacement::Node::BiasN, llvm::SpillPlacement::Node::BiasP, llvm::SmallVectorTemplateCommon< T, typename >::end(), getThreshold(), I, llvm::SpillPlacement::Node::Links, llvm::SpillPlacement::Node::preferReg(), and llvm::SpillPlacement::Node::Value.
Referenced by llvm::SpillPlacement::iterate(), and llvm::SpillPlacement::scanActiveBundles().
BiasN - Sum of blocks that prefer a spill.
Definition at line 95 of file SpillPlacement.cpp.
Referenced by llvm::SpillPlacement::Node::addBias(), llvm::SpillPlacement::Node::clear(), llvm::SpillPlacement::Node::mustSpill(), and llvm::SpillPlacement::Node::update().
BiasP - Sum of blocks that prefer a register.
Definition at line 97 of file SpillPlacement.cpp.
Referenced by llvm::SpillPlacement::Node::addBias(), llvm::SpillPlacement::Node::clear(), llvm::SpillPlacement::Node::mustSpill(), and llvm::SpillPlacement::Node::update().
Links - (Weight, BundleNo) for all transparent blocks connecting to other bundles. The weights are all positive block frequencies.
Definition at line 108 of file SpillPlacement.cpp.
Referenced by llvm::SpillPlacement::Node::addLink(), llvm::SpillPlacement::Node::clear(), and llvm::SpillPlacement::Node::update().
SumLinkWeights - Cached sum of the weights of all links + ThresHold.
Definition at line 111 of file SpillPlacement.cpp.
Referenced by llvm::SpillPlacement::Node::addLink(), llvm::SpillPlacement::Node::clear(), and llvm::SpillPlacement::Node::mustSpill().
Value - Output value of this node computed from the Bias and links. This is always on of the values {-1, 0, 1}. A positive number means the variable should go in a register through this bundle.
Definition at line 102 of file SpillPlacement.cpp.
Referenced by llvm::SpillPlacement::Node::update().