diff options
author | Mingming Liu <mingmingl@google.com> | 2025-01-22 21:06:46 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-22 21:06:46 -0800 |
commit | de209fa11b5455155228bcdba012b6074388b917 (patch) | |
tree | 2bffdd7ea198a5505369b03835c41f864cbc1494 /llvm/lib/CodeGen/TargetPassConfig.cpp | |
parent | 163935a48df69bde944fae2b4581541dab30c730 (diff) | |
download | llvm-de209fa11b5455155228bcdba012b6074388b917.zip llvm-de209fa11b5455155228bcdba012b6074388b917.tar.gz llvm-de209fa11b5455155228bcdba012b6074388b917.tar.bz2 |
[CodeGen] Introduce Static Data Splitter pass (#122183)
https://discourse.llvm.org/t/rfc-profile-guided-static-data-partitioning/83744
proposes to partition static data sections.
This patch introduces a codegen pass. This patch produces jump table
hotness in the in-memory states (machine jump table info and entries).
Target-lowering and asm-printer consume the states and produce `.hot`
section suffix. The follow up PR
https://github.com/llvm/llvm-project/pull/122215 implements such
changes.
---------
Co-authored-by: Ellis Hoag <ellis.sparky.hoag@gmail.com>
Diffstat (limited to 'llvm/lib/CodeGen/TargetPassConfig.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetPassConfig.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetPassConfig.cpp b/llvm/lib/CodeGen/TargetPassConfig.cpp index 5c05589..d8d9f38 100644 --- a/llvm/lib/CodeGen/TargetPassConfig.cpp +++ b/llvm/lib/CodeGen/TargetPassConfig.cpp @@ -261,6 +261,11 @@ static cl::opt<bool> GCEmptyBlocks("gc-empty-basic-blocks", cl::init(false), cl::Hidden, cl::desc("Enable garbage-collecting empty basic blocks")); +static cl::opt<bool> + SplitStaticData("split-static-data", cl::Hidden, cl::init(false), + cl::desc("Split static data sections into hot and cold " + "sections using profile information")); + /// Allow standard passes to be disabled by command line options. This supports /// simple binary flags that either suppress the pass or do nothing. /// i.e. -disable-mypass=false has no effect. @@ -1251,6 +1256,8 @@ void TargetPassConfig::addMachinePasses() { } } addPass(createMachineFunctionSplitterPass()); + if (SplitStaticData) + addPass(createStaticDataSplitterPass()); } // We run the BasicBlockSections pass if either we need BB sections or BB // address map (or both). |