[PATCH] D40891: Fix accidentally quadratic time in BlockFrequencyInfoImpl::propagateMassToSuccessors
Andrew Scheidecker via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 6 05:22:04 PST 2017
AndrewScheidecker updated this revision to Diff 125716.
AndrewScheidecker added a comment.
Include full context in diff, as suggested on IRC
Repository:
rL LLVM
https://reviews.llvm.org/D40891
Files:
include/llvm/Analysis/BlockFrequencyInfoImpl.h
Index: include/llvm/Analysis/BlockFrequencyInfoImpl.h
===================================================================
--- include/llvm/Analysis/BlockFrequencyInfoImpl.h
+++ include/llvm/Analysis/BlockFrequencyInfoImpl.h
@@ -1314,11 +1314,14 @@
return false;
} else {
const BlockT *BB = getBlock(Node);
- for (const auto Succ : children<const BlockT *>(BB))
- if (!addToDist(Dist, OuterLoop, Node, getNode(Succ),
- getWeightFromBranchProb(BPI->getEdgeProbability(BB, Succ))))
- // Irreducible backedge.
- return false;
+ for (auto SuccI = GraphTraits<const BlockT *>::child_begin(BB),
+ SuccE = GraphTraits<const BlockT *>::child_end(BB);
+ SuccI != SuccE;
+ ++SuccI)
+ if (!addToDist(Dist, OuterLoop, Node, getNode(*SuccI),
+ getWeightFromBranchProb(BPI->getEdgeProbability(BB, SuccI))))
+ // Irreducible backedge.
+ return false;
}
// Distribute mass to successors, saving exit and backedge data in the
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40891.125716.patch
Type: text/x-patch
Size: 1030 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171206/71ca8ffd/attachment.bin>
More information about the llvm-commits
mailing list