diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-04-25 04:38:12 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-04-25 04:38:12 +0000 |
commit | c9b7cfea2f0a83ac84d2dccc3b9ea817ca02aa9d (patch) | |
tree | 654090d8eec77449247601543702711fa1ea305d /llvm/lib | |
parent | 1cab8a070837053b2335b50ab0fd61cd34b0fc6b (diff) | |
download | bcm5719-llvm-c9b7cfea2f0a83ac84d2dccc3b9ea817ca02aa9d.tar.gz bcm5719-llvm-c9b7cfea2f0a83ac84d2dccc3b9ea817ca02aa9d.zip |
blockfreq: Expose getPackagedNode()
Make `getPackagedNode()` a member function of
`BlockFrequencyInfoImplBase` so that it's available for templated code.
<rdar://problem/14292693>
llvm-svn: 207183
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp b/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp index 761bda5aa9b..d58a7435a35 100644 --- a/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp +++ b/llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp @@ -614,29 +614,6 @@ static void cleanup(BlockFrequencyInfoImplBase &BFI) { BFI.Freqs = std::move(SavedFreqs); } -/// \brief Get a possibly packaged node. -/// -/// Get the node currently representing Node, which could be a containing -/// loop. -/// -/// This function should only be called when distributing mass. As long as -/// there are no irreducilbe edges to Node, then it will have complexity O(1) -/// in this context. -/// -/// In general, the complexity is O(L), where L is the number of loop headers -/// Node has been packaged into. Since this method is called in the context -/// of distributing mass, L will be the number of loop headers an early exit -/// edge jumps out of. -static BlockNode getPackagedNode(const BlockFrequencyInfoImplBase &BFI, - const BlockNode &Node) { - assert(Node.isValid()); - if (!BFI.Working[Node.Index].isPackaged()) - return Node; - if (!BFI.Working[Node.Index].isAPackage()) - return Node; - return getPackagedNode(BFI, BFI.Working[Node.Index].getContainingHeader()); -} - /// \brief Get the appropriate mass for a possible pseudo-node loop package. /// /// Get appropriate mass for Node. If Node is a loop-header (whose loop has @@ -682,7 +659,7 @@ void BlockFrequencyInfoImplBase::addToDist(Distribution &Dist, Dist.addBackedge(OuterLoop->getHeader(), Weight); return; } - BlockNode Resolved = getPackagedNode(*this, Succ); + BlockNode Resolved = getPackagedNode(Succ); assert(!isLoopHeader(Resolved)); if (Working[Resolved.Index].getContainingLoop() != OuterLoop) { |