[PATCH] D83265: [MBP] Use profile count to compute tail dup cost if it is available

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 10 08:51:33 PDT 2020


davidxl added a comment.

A few things:

1. can this be extended to the TailDup pass too?
2. what is the impact on text size?
3. what is the performance with AFDO and XFDO?

4. Can the threshold be tuned higher (with more performnace)?



================
Comment at: llvm/lib/CodeGen/MachineBlockPlacement.cpp:420
+  /// The return value is used to model tail duplication cost.
+  BlockFrequency getBlockCountOrFrequency(const MachineBasicBlock *BB) {
+    if (UseProfileCount) {
----------------
This should probbaly return Optional<..>


================
Comment at: llvm/lib/CodeGen/MachineBlockPlacement.cpp:426
+      else
+        return 0;
+    }
----------------
Return None here. Also when None is returned, I think the caller needs to handle it conservatively -- perhaps resort to Freq based method


================
Comment at: llvm/lib/CodeGen/MachineBlockPlacement.cpp:3167
+  SmallVector<MachineBasicBlock *, 8> Succs;
+  for (MachineBasicBlock *Succ : BB->successors()) {
+    if (BlockFilter && !BlockFilter->count(Succ))
----------------
Is this change related?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83265





More information about the llvm-commits mailing list