[PATCH] D136332: [FuncSpec][NFC] Avoid redundant computations of DominatorTree/LoopInfo
Momchil Velikov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 24 09:15:31 PDT 2022
chill marked an inline comment as done.
chill added inline comments.
================
Comment at: llvm/lib/Transforms/Utils/SCCPSolver.cpp:342-347
+ const LoopInfo &getLoopInfo(Function &F) {
+ auto A = AnalysisResults.find(&F);
+ assert(A != AnalysisResults.end() && A->second.LI &&
+ "Need LoopInfo analysis results for function.");
+ return *A->second.LI;
+ }
----------------
labrinea wrote:
> SjoerdMeijer wrote:
> > ChuanqiXu wrote:
> > > I feel like the assertion may be triggered if we run specializer on the specialized functions. This **looks** possible when `FuncSpecializationMaxIters>1` but we only calculate the analysis once.
> > Or with the legacy pass manager? Is that how I should read the comment above:
> >
> > // We cannot preserve the LI, DT, or PDT with the legacy pass ...
> @ChuanqiXu I don't think we ever pass cloned functions to `findSpecializations()` (see isCandidateFunction() - it early returns if SpecializedFuncs.contains(F))
Yeah, I had a workaround (see a previous version of the patch), but AFAICT, LegacyPM is no longer supported, see https://discourse.llvm.org/t/legacy-pm-in-llvm-15/64305
(and was supposed to be removed one LLVM release ago :D )
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D136332/new/
https://reviews.llvm.org/D136332
More information about the llvm-commits
mailing list