[PATCH] D80387: [SDAG] Don't require LazyBlockFrequencyInfo at optnone
Hiroshi Yamauchi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 21 11:54:08 PDT 2020
yamauchi added inline comments.
================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:447
+ if (PSI && PSI->hasProfileSummary()) {
+ auto *LBFI = getAnalysisIfAvailable<LazyBlockFrequencyInfoPass>();
+ BFI = LBFI ? &LBFI->getBFI() : nullptr;
----------------
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).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80387/new/
https://reviews.llvm.org/D80387
More information about the llvm-commits
mailing list