diff options
author | Amir Ayupov <aaupov@fb.com> | 2023-05-03 16:40:29 -0700 |
---|---|---|
committer | Amir Ayupov <aaupov@fb.com> | 2023-05-04 10:30:48 -0700 |
commit | f7643f8da3fb2ccfbe8eb8a9a6c14b4ddf6eb60f (patch) | |
tree | 7528383c668e160a3b722b6aef004151d535bd2d /bolt | |
parent | 0e1429add57f4c33da9dbc2bc5c9de7654f3b32d (diff) | |
download | llvm-f7643f8da3fb2ccfbe8eb8a9a6c14b4ddf6eb60f.zip llvm-f7643f8da3fb2ccfbe8eb8a9a6c14b4ddf6eb60f.tar.gz llvm-f7643f8da3fb2ccfbe8eb8a9a6c14b4ddf6eb60f.tar.bz2 |
[BOLT] Remove redundant dumps in AsmDump
Dumping jump table and tail call fdata is covered by subsequent iteration over
successors.
Reviewed By: #bolt, maksfb
Differential Revision: https://reviews.llvm.org/D149799
Diffstat (limited to 'bolt')
-rw-r--r-- | bolt/lib/Passes/AsmDump.cpp | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/bolt/lib/Passes/AsmDump.cpp b/bolt/lib/Passes/AsmDump.cpp index c163345..18d0395 100644 --- a/bolt/lib/Passes/AsmDump.cpp +++ b/bolt/lib/Passes/AsmDump.cpp @@ -55,34 +55,6 @@ void dumpCFI(const BinaryFunction &BF, const MCInst &Instr, AsmPrinter &MAP) { } } -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 @@ void dumpFunction(const BinaryFunction &BF) { 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). |