LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Public Attributes | List of all members
llvm::SpillPlacement::Node Struct Reference
Collaboration diagram for llvm::SpillPlacement::Node:
Collaboration graph
[legend]

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. More...
 
bool mustSpill () const
 mustSpill - Return True if this node is so biased that it must spill. More...
 
void clear ()
 clear - Reset per-query data, but preserve frequencies that only depend on 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[])
 

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
 
LinkVector Links
 
BlockFrequency SumLinkWeights
 SumLinkWeights - Cached sum of the weights of all links + ThresHold. More...
 

Detailed Description

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 75 of file SpillPlacement.cpp.

Member Typedef Documentation

Definition at line 86 of file SpillPlacement.cpp.

Member Function Documentation

void llvm::SpillPlacement::Node::addBias ( BlockFrequency  freq,
BorderConstraint  direction 
)
inline
void llvm::SpillPlacement::Node::addLink ( unsigned  b,
BlockFrequency  w 
)
inline
void llvm::SpillPlacement::Node::clear ( )
inline
bool llvm::SpillPlacement::Node::mustSpill ( ) const
inline

mustSpill - Return True if this node is so biased that it must spill.

Definition at line 102 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 96 of file SpillPlacement.cpp.

Referenced by llvm::SpillPlacement::Node::update().

bool llvm::SpillPlacement::Node::update ( const Node  nodes[])
inline

Member Data Documentation

BlockFrequency llvm::SpillPlacement::Node::BiasN
BlockFrequency llvm::SpillPlacement::Node::BiasP
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 90 of file SpillPlacement.cpp.

Referenced by llvm::SpillPlacement::Node::addLink(), llvm::SpillPlacement::Node::clear(), and llvm::SpillPlacement::Node::update().

BlockFrequency llvm::SpillPlacement::Node::SumLinkWeights

SumLinkWeights - Cached sum of the weights of all links + ThresHold.

Definition at line 93 of file SpillPlacement.cpp.

Referenced by llvm::SpillPlacement::Node::addLink(), llvm::SpillPlacement::Node::clear(), and 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 84 of file SpillPlacement.cpp.

Referenced by llvm::SpillPlacement::Node::update().


The documentation for this struct was generated from the following file: