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

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 3 10:12:04 PST 2020


davidxl added inline comments.


================
Comment at: llvm/lib/CodeGen/MachineBlockPlacement.cpp:3073
+
+BlockFrequency MachineBlockPlacement::scaleThreshold(MachineBasicBlock *BB) {
+  return DupThreshold.getFrequency() * countMBBInstruction(BB);
----------------
Add a comment explaining the scaling.


================
Comment at: llvm/lib/CodeGen/MachineBlockPlacement.cpp:3138
+  if (SuccIt != Succs.end()) {
+    DefaultBranchProb = MBPI->getEdgeProbability(BB, *SuccIt).getCompl();
+  }
----------------
it assumes *SuccIt is the layout successor (fall through bb). Is it always the case?


================
Comment at: llvm/lib/CodeGen/MachineBlockPlacement.cpp:3168
+  //
+  // The duplication benefit of a predecessor is defined as
+  //         Orig_taken_branch - Duplicated_taken_branch
----------------
"the benefit of duplicating into a predecessor is .."


================
Comment at: llvm/lib/CodeGen/MachineBlockPlacement.cpp:3172
+  // The Orig_taken_branch is computed with the assumption that predecessor
+  // jumps to BB and the most possible successor is layout after BB.
+  //
----------------
laid out


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

https://reviews.llvm.org/D73387





More information about the llvm-commits mailing list