mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-22 10:33:23 +00:00
blockfreq: Document high-level functions
<rdar://problem/14292693> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207191 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7cb80111c3
commit
16df231a82
@ -1365,12 +1365,47 @@ template <class BT> class BlockFrequencyInfoImpl : BlockFrequencyInfoImplBase {
|
|||||||
return RPOT[Node.Index];
|
return RPOT[Node.Index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// \brief Run (and save) a post-order traversal.
|
||||||
|
///
|
||||||
|
/// Saves a reverse post-order traversal of all the nodes in \a F.
|
||||||
void initializeRPOT();
|
void initializeRPOT();
|
||||||
|
|
||||||
|
/// \brief Initialize loop data.
|
||||||
|
///
|
||||||
|
/// Build up \a Loops using \a LoopInfo. \a LoopInfo gives us a mapping from
|
||||||
|
/// each block to the deepest loop it's in, but we need the inverse. For each
|
||||||
|
/// loop, we store in reverse post-order its "immediate" members, defined as
|
||||||
|
/// the header, the headers of immediate sub-loops, and all other blocks in
|
||||||
|
/// the loop that are not in sub-loops.
|
||||||
void initializeLoops();
|
void initializeLoops();
|
||||||
|
|
||||||
|
/// \brief Propagate to a block's successors.
|
||||||
|
///
|
||||||
|
/// In the context of distributing mass through \c OuterLoop, divide the mass
|
||||||
|
/// currently assigned to \c Node between its successors.
|
||||||
void propagateMassToSuccessors(LoopData *OuterLoop, const BlockNode &Node);
|
void propagateMassToSuccessors(LoopData *OuterLoop, const BlockNode &Node);
|
||||||
void computeMassInLoops();
|
|
||||||
|
/// \brief Compute mass in a particular loop.
|
||||||
|
///
|
||||||
|
/// Assign mass to \c Loop's header, and then for each block in \c Loop in
|
||||||
|
/// reverse post-order, distribute mass to its successors. Only visits nodes
|
||||||
|
/// that have not been packaged into sub-loops.
|
||||||
|
///
|
||||||
|
/// \pre \a computeMassInLoop() has been called for each subloop of \c Loop.
|
||||||
void computeMassInLoop(LoopData &Loop);
|
void computeMassInLoop(LoopData &Loop);
|
||||||
|
|
||||||
|
/// \brief Compute mass in all loops.
|
||||||
|
///
|
||||||
|
/// For each loop bottom-up, call \a computeMassInLoop().
|
||||||
|
void computeMassInLoops();
|
||||||
|
|
||||||
|
/// \brief Compute mass in the top-level function.
|
||||||
|
///
|
||||||
|
/// Assign mass to the entry block, and then for each block in reverse
|
||||||
|
/// post-order, distribute mass to its successors. Skips nodes that have
|
||||||
|
/// been packaged into loops.
|
||||||
|
///
|
||||||
|
/// \pre \a computeMassInLoops() has been called.
|
||||||
void computeMassInFunction();
|
void computeMassInFunction();
|
||||||
|
|
||||||
std::string getBlockName(const BlockNode &Node) const override {
|
std::string getBlockName(const BlockNode &Node) const override {
|
||||||
|
@ -815,7 +815,7 @@ static void unwrapLoop(BlockFrequencyInfoImplBase &BFI, LoopData &Loop) {
|
|||||||
<< "\n");
|
<< "\n");
|
||||||
Loop.Scale *= Loop.Mass.toFloat();
|
Loop.Scale *= Loop.Mass.toFloat();
|
||||||
Loop.IsPackaged = false;
|
Loop.IsPackaged = false;
|
||||||
DEBUG(dbgs() << " => combined-scale = " << Loop.Scale << "\n");
|
DEBUG(dbgs() << " => combined-scale = " << Loop.Scale << "\n");
|
||||||
|
|
||||||
// Propagate the head scale through the loop. Since members are visited in
|
// Propagate the head scale through the loop. Since members are visited in
|
||||||
// RPO, the head scale will be updated by the loop scale first, and then the
|
// RPO, the head scale will be updated by the loop scale first, and then the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user