[PATCH] D98103: [NPM] Do not run function simplification pipeline unnecessarily

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 14 13:47:29 PDT 2021


aeubanks added inline comments.


================
Comment at: llvm/lib/Analysis/CGSCCPassManager.cpp:906
+
+  if (InvalidateSA)
+    FAM.invalidate<FunctionStatusAnalysis>(N.getFunction());
----------------
mtrofin wrote:
> aeubanks wrote:
> > mtrofin wrote:
> > > aeubanks wrote:
> > > > can this be `!FunctionPass`?
> > > then we wouldn't invalidate when updateCGAndAnalysisManagerForFunctionPass is called. CoroSplit calls it, for instance. 
> > I feel like I'm missing something obvious, why is this invalidate here necessary? Can we just see what the passes invalidate?
> When passes call into here, I we can assume FunctionStatusAnalysis can be invalidated because something changed.
> 
> But this is also entered from line 596, which happens after the function simplification pipeline finishes. The last thing that the pipeline does is it caches a FunctionStatusAnalysis::Result. Well, so next thing that would happen is we'd yank it here - unless we indicate this is the one case we don't want that to happen.
How would it be yanked? The RequireAnalysis pass after the function simplification pipeline preserves all analyses.
Removing these two lines and running check-llvm still passes.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98103



More information about the llvm-commits mailing list