[PATCH] D65060: [LICM] Make Loop ICM profile aware

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 22 11:51:17 PDT 2019


wenlei marked an inline comment as done.
wenlei added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LICM.cpp:804
+  BasicBlock *SrcBlock = I.getParent();
+  if (BFI->getBlockFreq(SrcBlock) < BFI->getBlockFreq(DstBlock)) {
+    ORE->emit([&]() {
----------------
vsk wrote:
> IIRC BFI returns a 0 frequency if information about a block is missing. If information for either block is missing, shouldn't this fall back to the non-PGO behavior?
Hmm.. how can we differentiate between missing info vs. the block count is really just 0? My understanding is 1) if profile isn't available in general or for this function, BPI would use static info about the CFG to estimate weights (BranchProbabilityInfo::calculate), thus BFI automatically gets a "synthetic" static profile; 2) if information is missing because we don't have profile for that block, that's likely AutoFDO instead of Instr. PGO, and SampleProfileLoader::propagateWeights would try to infer if possible, but that's more of a profile accuracy issue. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65060





More information about the llvm-commits mailing list