[PATCH] D74809: [MBP][X86] Include static prof data when collecting loop BBs
David Li via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 20 14:40:09 PDT 2020
davidxl added inline comments.
================
Comment at: llvm/lib/CodeGen/MachineBlockPlacement.cpp:2516
+ if (F->getFunction().hasProfileData() || ForceLoopColdBlock ||
+ L.hasStaticProfInfo()) {
BlockFrequency LoopFreq(0);
----------------
The check here seems too weak. One branch in the loop has user annotation does not mean other branch probablity data can be trusted. More sophisticated analysis is needed.
================
Comment at: llvm/lib/CodeGen/MachineLoopInfo.cpp:114
+bool MachineLoop::hasStaticProfInfo() const {
+ return llvm::any_of(blocks(), [](const MachineBasicBlock *MBB){
----------------
Note that with PGO is on, the branches are also annotated with MD_prof meta data. In other words, you will also need to check fhat the function entry does not have profile count.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74809/new/
https://reviews.llvm.org/D74809
More information about the llvm-commits
mailing list