[PATCH] D124529: [CompileTime] [Passes] Avoid computing unnecessary analyses. NFC

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 27 12:46:13 PDT 2022


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp:663
+    if (LI.empty())
+      return false;
     auto &LAA = getAnalysis<LoopAccessLegacyAnalysis>();
----------------
This doesn't really make sense for the legacy pass manager, because it will always calculate the analysis, independently of whether it is actually accessed. I'd suggest leaving the LegacyPM implementation alone.


================
Comment at: llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp:713
                                                FunctionAnalysisManager &AM) {
-  auto &SE = AM.getResult<ScalarEvolutionAnalysis>(F);
+  auto &DT = AM.getResult<DominatorTreeAnalysis>(F);
   auto &LI = AM.getResult<LoopAnalysis>(F);
----------------
I would keep the DT fetch below the LI.empty() check as well. Yes, it's not going to matter for compile-time because LI computes DT anyway, but there's also no need to specially highlight DT here. Same below.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124529



More information about the llvm-commits mailing list