[PATCH] D79037: [StructurizeCFG] Fix region nodes ordering
Ehud Katz via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 1 03:41:52 PDT 2020
ekatz marked an inline comment as done.
ekatz added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/StructurizeCFG.cpp:365
-/// Use the exit block to determine the loop if RN is a SubRegion.
-Loop *StructurizeCFG::getAdjustedLoop(RegionNode *RN) {
- if (RN->isSubRegion()) {
- Region *SubRegion = RN->getNodeAs<Region>();
- return LI->getLoopFor(SubRegion->getExit());
- }
-
- return LI->getLoopFor(RN->getEntry());
-}
-
-/// Use the exit block to determine the loop depth if RN is a SubRegion.
-unsigned StructurizeCFG::getAdjustedLoopDepth(RegionNode *RN) {
- if (RN->isSubRegion()) {
- Region *SubR = RN->getNodeAs<Region>();
- return LI->getLoopDepth(SubR->getExit());
- }
-
- return LI->getLoopDepth(RN->getEntry());
-}
-
-/// Build up the general order of nodes
+/// Build up the general order of nodes, by performing a topology sort of the
+/// parent region's nodes, while ensuring that there is no outer cycle node
----------------
foad wrote:
> It's normally called a "topological" sort.
Will fix the comment. Thanks.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D79037/new/
https://reviews.llvm.org/D79037
More information about the llvm-commits
mailing list