[PATCH] D149799: [BOLT] Remove redundant dumps in AsmDump

Amir Ayupov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 3 16:42:48 PDT 2023


Amir created this revision.
Amir added a reviewer: bolt.
Herald added a reviewer: rafauler.
Herald added subscribers: treapster, ayermolo.
Herald added a reviewer: maksfb.
Herald added a project: All.
Amir requested review of this revision.
Herald added subscribers: llvm-commits, yota9.
Herald added a project: LLVM.

Dumping jump table and tail call fdata is covered by subsequent iteration over
successors.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D149799

Files:
  bolt/lib/Passes/AsmDump.cpp


Index: bolt/lib/Passes/AsmDump.cpp
===================================================================
--- bolt/lib/Passes/AsmDump.cpp
+++ bolt/lib/Passes/AsmDump.cpp
@@ -55,34 +55,6 @@
   }
 }
 
-void dumpJumpTableFdata(raw_ostream &OS, const BinaryFunction &BF,
-                        const MCInst &Instr, const std::string &BranchLabel) {
-  StringRef FunctionName = BF.getOneName();
-  const JumpTable *JT = BF.getJumpTable(Instr);
-  for (uint32_t i = 0; i < JT->Entries.size(); ++i) {
-    StringRef TargetName = JT->Entries[i]->getName();
-    const uint64_t Mispreds = JT->Counts[i].Mispreds;
-    const uint64_t Count = JT->Counts[i].Count;
-    OS << "# FDATA: 1 " << FunctionName << " #" << BranchLabel << "# "
-       << "1 " << FunctionName << " #" << TargetName << "# " << Mispreds << " "
-       << Count << '\n';
-  }
-}
-
-void dumpTailCallFdata(raw_ostream &OS, const BinaryFunction &BF,
-                       const MCInst &Instr, const std::string &BranchLabel) {
-  const BinaryContext &BC = BF.getBinaryContext();
-  StringRef FunctionName = BF.getOneName();
-  auto CallFreq = BC.MIB->getAnnotationWithDefault<uint64_t>(Instr, "Count");
-  const MCSymbol *Target = BC.MIB->getTargetSymbol(Instr);
-  const BinaryFunction *TargetBF = BC.getFunctionForSymbol(Target);
-  if (!TargetBF)
-    return;
-  OS << "# FDATA: 1 " << FunctionName << " #" << BranchLabel << "# "
-     << "1 " << TargetBF->getPrintName() << " 0 "
-     << "0 " << CallFreq << '\n';
-}
-
 void dumpTargetFunctionStub(raw_ostream &OS, const BinaryContext &BC,
                             const MCSymbol *CalleeSymb,
                             const BinarySection *&LastCS) {
@@ -230,12 +202,6 @@
 
       BC.InstPrinter->printInst(&Instr, 0, "", *BC.STI, OS);
       OS << '\n';
-
-      // Dump profile data in FDATA format (as parsed by link_fdata).
-      if (BC.MIB->getJumpTable(Instr))
-        dumpJumpTableFdata(OS, BF, Instr, BranchLabel);
-      else if (BC.MIB->isTailCall(Instr))
-        dumpTailCallFdata(OS, BF, Instr, BranchLabel);
     }
 
     // Dump profile data in FDATA format (as parsed by link_fdata).


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149799.519301.patch
Type: text/x-patch
Size: 2124 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230503/3043d2dc/attachment.bin>


More information about the llvm-commits mailing list