[PATCH] D73387: [MBP] Partial tail duplication into hot predecessors

Guozhi Wei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 3 16:03:48 PST 2020


Carrot added inline comments.


================
Comment at: llvm/lib/CodeGen/MachineBlockPlacement.cpp:3138
+  if (SuccIt != Succs.end()) {
+    DefaultBranchProb = MBPI->getEdgeProbability(BB, *SuccIt).getCompl();
+  }
----------------
davidxl wrote:
> it assumes *SuccIt is the layout successor (fall through bb). Is it always the case?
No, *SuccIt may have other predecessors can fall through to it.
After sorting Succs, Succs.begin() has the largest probability among edges come out from BB. So *SuccIt has the largest chance to be laid after BB. 

Consider other cases may improve the following cost analysis. But I think the extra benefit is very small with much more complicated implementation.


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

https://reviews.llvm.org/D73387





More information about the llvm-commits mailing list