diff options
author | ShatianWang <38512325+ShatianWang@users.noreply.github.com> | 2023-11-29 15:43:21 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-29 15:43:21 -0500 |
commit | 076bd22f579ec4c90b41c700fca21a90fd2b6dbc (patch) | |
tree | f7b1ff09f16173345b06ca587278c0163a2f00e4 /bolt/lib/Rewrite/BinaryPassManager.cpp | |
parent | 69b0cb9c567eb0f937474f5424b9ed23b61c04d7 (diff) | |
download | llvm-076bd22f579ec4c90b41c700fca21a90fd2b6dbc.zip llvm-076bd22f579ec4c90b41c700fca21a90fd2b6dbc.tar.gz llvm-076bd22f579ec4c90b41c700fca21a90fd2b6dbc.tar.bz2 |
[BOLT] Add structure of CDSplit to SplitFunctions (#73430)
This commit establishes the general structure of the CDSplit strategy in
SplitFunctions without incorporating the exact splitting logic. With
-split-functions -split-strategy=cdsplit, the SplitFunctions pass will
run twice: the first time is before function reordering and functions
are hot-cold split; the second time is after function reordering and
functions are hot-warm-cold split based on the fixed function ordering.
Currently, all functions are hot-warm split after the entry block in the
second splitting pass. Subsequent commits will introduce the precise
splitting logic. NFC.
Diffstat (limited to 'bolt/lib/Rewrite/BinaryPassManager.cpp')
-rw-r--r-- | bolt/lib/Rewrite/BinaryPassManager.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bolt/lib/Rewrite/BinaryPassManager.cpp b/bolt/lib/Rewrite/BinaryPassManager.cpp index 37de3ea..9946608 100644 --- a/bolt/lib/Rewrite/BinaryPassManager.cpp +++ b/bolt/lib/Rewrite/BinaryPassManager.cpp @@ -430,6 +430,13 @@ void BinaryFunctionPassManager::runAllPasses(BinaryContext &BC) { Manager.registerPass( std::make_unique<ReorderFunctions>(PrintReorderedFunctions)); + // This is the second run of the SplitFunctions pass required by certain + // splitting strategies (e.g. cdsplit). Running the SplitFunctions pass again + // after ReorderFunctions allows the finalized function order to be utilized + // to make more sophisticated splitting decisions, like hot-warm-cold + // splitting. + Manager.registerPass(std::make_unique<SplitFunctions>(PrintSplit)); + // Print final dyno stats right while CFG and instruction analysis are intact. Manager.registerPass( std::make_unique<DynoStatsPrintPass>( |