[all-commits] [llvm/llvm-project] 4483cf: [BOLT] CDSplit main logic part 2/2 (#74032)
ShatianWang via All-commits
all-commits at lists.llvm.org
Thu Nov 30 20:17:28 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 4483cf2d8b294aa8718b5488f2033675895369da
https://github.com/llvm/llvm-project/commit/4483cf2d8b294aa8718b5488f2033675895369da
Author: ShatianWang <38512325+ShatianWang at users.noreply.github.com>
Date: 2023-11-30 (Thu, 30 Nov 2023)
Changed paths:
M bolt/lib/Passes/SplitFunctions.cpp
A bolt/test/X86/cdsplit-call-scale.s
A bolt/test/X86/cdsplit-symbol-names.s
Log Message:
-----------
[BOLT] CDSplit main logic part 2/2 (#74032)
This diff implements the main splitting logic of CDSplit. CDSplit
processes functions in a binary in parallel. For each function BF, it
assumes that all other functions are hot-cold split. For each possible
hot-warm split point of BF, it computes its corresponding SplitScore,
and chooses the split point with the best SplitScore. The SplitScore of
each split point is computed in the following way: each call edge or
jump edge has an edge score that is proportional to its execution count,
and inversely proportional to its distance. The SplitScore of a split
point is a sum of edge scores over a fixed set of edges whose distance
can change due to hot-warm splitting BF. This set contains all cover
calls in the form of X->Y or Y->X given function order [... X ... BF ...
Y ...]; we refer to the sum of edge scores over the set of cover calls
as CoverCallScore. This set also contains all jump edges (branches)
within BF as well as all call edges originated from BF; we refer to the
sum of edge scores over this set of edges as LocalScore. CDSplit finds
the split index maximizing CoverCallScore + LocalScore.
More information about the All-commits
mailing list