[llvm] r309662 - [PM] Add a comment clarifying what a particular predicate is doing.
Chandler Carruth via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 31 23:40:11 PDT 2017
Author: chandlerc
Date: Mon Jul 31 23:40:11 2017
New Revision: 309662
URL: http://llvm.org/viewvc/llvm-project?rev=309662&view=rev
Log:
[PM] Add a comment clarifying what a particular predicate is doing.
This came up as a point of confusion while working on a fundamental
problem with the combination of CGSCC iteration and the inliner.
Modified:
llvm/trunk/lib/Analysis/CGSCCPassManager.cpp
Modified: llvm/trunk/lib/Analysis/CGSCCPassManager.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CGSCCPassManager.cpp?rev=309662&r1=309661&r2=309662&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/CGSCCPassManager.cpp (original)
+++ llvm/trunk/lib/Analysis/CGSCCPassManager.cpp Mon Jul 31 23:40:11 2017
@@ -619,6 +619,14 @@ LazyCallGraph::SCC &llvm::updateCGAndAna
AM.invalidate(*C, PA);
}
auto NewSCCIndex = RC->find(*C) - RC->begin();
+ // If we have actually moved an SCC to be topologically "below" the current
+ // one due to merging, we will need to revisit the current SCC after
+ // visiting those moved SCCs.
+ //
+ // It is critical that we *do not* revisit the current SCC unless we
+ // actually move SCCs in the process of merging because otherwise we may
+ // form a cycle where an SCC is split apart, merged, split, merged and so
+ // on infinitely.
if (InitialSCCIndex < NewSCCIndex) {
// Put our current SCC back onto the worklist as we'll visit other SCCs
// that are now definitively ordered prior to the current one in the
More information about the llvm-commits
mailing list