[PATCH] D136332: [FuncSpec][NFC] Avoid redundant computations of DominatorTree/LoopInfo

Chuanqi Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 24 19:04:04 PDT 2022


ChuanqiXu accepted this revision.
ChuanqiXu 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;
+  }
----------------
chill wrote:
> 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 )
Yeah, it makes sense.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136332/new/

https://reviews.llvm.org/D136332



More information about the llvm-commits mailing list