[PATCH] D80387: [SDAG] Don't require LazyBlockFrequencyInfo at optnone

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 21 12:59:39 PDT 2020


nikic marked 2 inline comments as done.
nikic added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:447
+  if (PSI && PSI->hasProfileSummary()) {
+    auto *LBFI = getAnalysisIfAvailable<LazyBlockFrequencyInfoPass>();
+    BFI = LBFI ? &LBFI->getBFI() : nullptr;
----------------
yamauchi wrote:
> Can we have this explicitly query OptLevel like above to be in sync, as in
> 
> ```
> if (PSI && PSI->hasProfileSummary() && OptLevel != CodeGenOpt::None) {
>   BFI = &getAnalysis<LazyBlockFrequencyInfoPass>().getBFI();
> }
> ```
> 
> I think that would be safer against accidental cases where the above and this code get out of sync for some reason and BFI silently gets dropped. Also, this is in line with the code that uses 'UseMBPI' below (line 465).
Good point, done!


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

https://reviews.llvm.org/D80387





More information about the llvm-commits mailing list