LLVM
8.0.1
|
Node - Each edge bundle corresponds to a Hopfield node. More...
Public Types | |
using | LinkVector = SmallVector< std::pair< BlockFrequency, unsigned >, 4 > |
Public Member Functions | |
bool | preferReg () const |
preferReg - Return true when this node prefers to be in a register. More... | |
bool | mustSpill () const |
mustSpill - Return True if this node is so biased that it must spill. More... | |
void | clear (const BlockFrequency &Threshold) |
clear - Reset per-query data, but preserve frequencies that only depend on the CFG. More... | |
void | addLink (unsigned b, BlockFrequency w) |
addLink - Add a link to bundle b with weight w. More... | |
void | addBias (BlockFrequency freq, BorderConstraint direction) |
addBias - Bias this node. More... | |
bool | update (const Node nodes[], const BlockFrequency &Threshold) |
update - Recompute Value from Bias and Links. More... | |
void | getDissentingNeighbors (SparseSet< unsigned > &List, const Node nodes[]) const |
Public Attributes | |
BlockFrequency | BiasN |
BiasN - Sum of blocks that prefer a spill. More... | |
BlockFrequency | BiasP |
BiasP - Sum of blocks that prefer a register. More... | |
int | Value |
Value - Output value of this node computed from the Bias and links. More... | |
LinkVector | Links |
Links - (Weight, BundleNo) for all transparent blocks connecting to other bundles. More... | |
BlockFrequency | SumLinkWeights |
SumLinkWeights - Cached sum of the weights of all links + ThresHold. More... | |
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 79 of file SpillPlacement.cpp.
using llvm::SpillPlacement::Node::LinkVector = SmallVector<std::pair<BlockFrequency, unsigned>, 4> |
Definition at line 91 of file SpillPlacement.cpp.
|
inline |
addBias - Bias this node.
Definition at line 138 of file SpillPlacement.cpp.
References freq, llvm::BlockFrequency::getMaxFrequency(), llvm::SpillPlacement::MustSpill, llvm::SpillPlacement::PrefReg, and llvm::SpillPlacement::PrefSpill.
|
inline |
addLink - Add a link to bundle b with weight w.
Definition at line 123 of file SpillPlacement.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), E, llvm::SmallVectorTemplateCommon< T, typename >::end(), I, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
|
inline |
clear - Reset per-query data, but preserve frequencies that only depend on the CFG.
Definition at line 116 of file SpillPlacement.cpp.
References llvm::SmallVectorImpl< T >::clear().
Referenced by llvm::SpillPlacement::Node::getDissentingNeighbors().
|
inline |
Definition at line 185 of file SpillPlacement.cpp.
References assert(), llvm::SpillPlacement::Node::clear(), llvm::BlockFrequency::getFrequency(), llvm::MachineFunction::getNumBlockIDs(), I, llvm::SparseSet< ValueT, KeyFunctorT, SparseT >::insert(), loops, llvm::max(), and nodes.
|
inline |
mustSpill - Return True if this node is so biased that it must spill.
Definition at line 107 of file SpillPlacement.cpp.
References llvm::SpillPlacement::Node::SumLinkWeights.
Referenced by llvm::SpillPlacement::scanActiveBundles().
|
inline |
preferReg - Return true when this node prefers to be in a register.
Definition at line 101 of file SpillPlacement.cpp.
Referenced by llvm::SpillPlacement::finish(), llvm::SpillPlacement::iterate(), llvm::SpillPlacement::scanActiveBundles(), and llvm::SpillPlacement::Node::update().
|
inline |
update - Recompute Value from Bias and Links.
Return true when node preference changes.
Definition at line 156 of file SpillPlacement.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SpillPlacement::Node::BiasN, llvm::SpillPlacement::Node::BiasP, E, llvm::SmallVectorTemplateCommon< T, typename >::end(), I, llvm::SpillPlacement::Node::preferReg(), and llvm::SpillPlacement::Node::Value.
Referenced by llvm::SpillPlacement::iterate(), and llvm::SpillPlacement::scanActiveBundles().
BlockFrequency llvm::SpillPlacement::Node::BiasN |
BiasN - Sum of blocks that prefer a spill.
Definition at line 81 of file SpillPlacement.cpp.
Referenced by llvm::SpillPlacement::Node::update().
BlockFrequency llvm::SpillPlacement::Node::BiasP |
BiasP - Sum of blocks that prefer a register.
Definition at line 84 of file SpillPlacement.cpp.
Referenced by llvm::SpillPlacement::Node::update().
LinkVector llvm::SpillPlacement::Node::Links |
Links - (Weight, BundleNo) for all transparent blocks connecting to other bundles.
The weights are all positive block frequencies.
Definition at line 95 of file SpillPlacement.cpp.
BlockFrequency llvm::SpillPlacement::Node::SumLinkWeights |
SumLinkWeights - Cached sum of the weights of all links + ThresHold.
Definition at line 98 of file SpillPlacement.cpp.
Referenced by llvm::SpillPlacement::Node::mustSpill().
int llvm::SpillPlacement::Node::Value |
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 89 of file SpillPlacement.cpp.
Referenced by llvm::SpillPlacement::Node::update().