aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/SafeStack.cpp
diff options
context:
space:
mode:
authorShatianWang <38512325+ShatianWang@users.noreply.github.com>2023-11-30 23:17:11 -0500
committerGitHub <noreply@github.com>2023-11-30 23:17:11 -0500
commit4483cf2d8b294aa8718b5488f2033675895369da (patch)
tree1d5cc933150c04e1733083d3253e2e070e7e750c /llvm/lib/CodeGen/SafeStack.cpp
parenta37c69ec315b9526a3532022be3ebe1af9ca356a (diff)
downloadllvm-4483cf2d8b294aa8718b5488f2033675895369da.zip
llvm-4483cf2d8b294aa8718b5488f2033675895369da.tar.gz
llvm-4483cf2d8b294aa8718b5488f2033675895369da.tar.bz2
[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.
Diffstat (limited to 'llvm/lib/CodeGen/SafeStack.cpp')
0 files changed, 0 insertions, 0 deletions