[PATCH] D158889: [AsmPrinter][PGO] Adds optional dumping of branch probabilities for PGO metrics.

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 25 15:14:41 PDT 2023


mtrofin accepted this revision.
mtrofin added a comment.
This revision is now accepted and ready to land.

This is great! Can you share what tracing methodology you use?

LGTM with some nits.



================
Comment at: llvm/include/llvm/CodeGen/AsmPrinter.h:390
+    const MCSymbol *Sym;
+    double Probability;
+  };
----------------
nit: init at declaration (both fields)


================
Comment at: llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1657
   bool CanDoExtraAnalysis = ORE->allowExtraAnalysis(DEBUG_TYPE);
+  const bool CanDumpBranchProbs = EnableBranchProbabilityDumping;
   for (auto &MBB : *MF) {
----------------
why not just use `EnableBranchProbabilityDumping`?


================
Comment at: llvm/test/Transforms/PGOProfile/asm_emit_branch_prob.ll:64
+
+;      CHECK-BP-SEC:Hex dump of section '.branch_probabilities':
+; CHECK-BP-SEC-NEXT:0x00000000 {{([[:xdigit:]]{8}) ([[:xdigit:]]{8})}} {{4c1d|c409}}0000 00000000 {{(.{16})}}
----------------
nit: line up the CHECK 


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

https://reviews.llvm.org/D158889



More information about the llvm-commits mailing list