[lld] 8d2b070 - [ELF] Internalize computeCacheDirectedSortOrder. NFC
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 5 16:19:15 PST 2025
Author: Fangrui Song
Date: 2025-01-05T16:19:09-08:00
New Revision: 8d2b070f07969f8358c93b9cf56834806fdc3efa
URL: https://github.com/llvm/llvm-project/commit/8d2b070f07969f8358c93b9cf56834806fdc3efa
DIFF: https://github.com/llvm/llvm-project/commit/8d2b070f07969f8358c93b9cf56834806fdc3efa.diff
LOG: [ELF] Internalize computeCacheDirectedSortOrder. NFC
and delete an incorremtn comment about ctx.arg.callGraphProfile
Added:
Modified:
lld/ELF/CallGraphSort.cpp
lld/ELF/CallGraphSort.h
lld/ELF/Writer.cpp
Removed:
################################################################################
diff --git a/lld/ELF/CallGraphSort.cpp b/lld/ELF/CallGraphSort.cpp
index 35c59d6edb2ad1..0b1b4196de37be 100644
--- a/lld/ELF/CallGraphSort.cpp
+++ b/lld/ELF/CallGraphSort.cpp
@@ -276,8 +276,8 @@ DenseMap<const InputSectionBase *, int> CallGraphSort::run() {
// Sort sections by the profile data using the Cache-Directed Sort algorithm.
// The placement is done by optimizing the locality by co-locating frequently
// executed code sections together.
-DenseMap<const InputSectionBase *, int>
-elf::computeCacheDirectedSortOrder(Ctx &ctx) {
+static DenseMap<const InputSectionBase *, int>
+computeCacheDirectedSortOrder(Ctx &ctx) {
SmallVector<uint64_t, 0> funcSizes;
SmallVector<uint64_t, 0> funcCounts;
SmallVector<codelayout::EdgeCount, 0> callCounts;
diff --git a/lld/ELF/CallGraphSort.h b/lld/ELF/CallGraphSort.h
index 5f9987ce097357..89e6f617d92156 100644
--- a/lld/ELF/CallGraphSort.h
+++ b/lld/ELF/CallGraphSort.h
@@ -15,9 +15,6 @@ namespace lld::elf {
struct Ctx;
class InputSectionBase;
-llvm::DenseMap<const InputSectionBase *, int>
-computeCacheDirectedSortOrder(Ctx &);
-
llvm::DenseMap<const InputSectionBase *, int>
computeCallGraphProfileOrder(Ctx &);
} // namespace lld::elf
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index 3e92b7653e31af..0ea2e60d8482ff 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -1083,7 +1083,6 @@ static void maybeShuffle(Ctx &ctx,
// Builds section order for handling --symbol-ordering-file.
static DenseMap<const InputSectionBase *, int> buildSectionOrder(Ctx &ctx) {
DenseMap<const InputSectionBase *, int> sectionOrder;
- // Use the rarely used option --call-graph-ordering-file to sort sections.
if (!ctx.arg.callGraphProfile.empty())
return computeCallGraphProfileOrder(ctx);
More information about the llvm-commits
mailing list