For test purposes, we want to split functions at a random split point
to be able to test different layouts without relying on the profile.
This patch introduces an option, that randomly chooses a split point
to partition blocks of a function into hot and cold regions.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thank you for working on this!
bolt/lib/Passes/SplitFunctions.cpp | ||
---|---|---|
147–150 | As a matter of preference - I try to wrap LLVM_DEBUG body with curly braces to indent it just like a regular code block. | |
bolt/test/X86/split-random.s | ||
6 | The test looks good and very clean! There's just one concern with regards to our NFC testing - I think we should specify the seed as an option to ensure identical binaries between runs. |
bolt/lib/Passes/SplitFunctions.cpp | ||
---|---|---|
174 | It seems that it could be moved under proper WorkFun |
bolt/lib/Passes/SplitFunctions.cpp | ||
---|---|---|
174 | If the generator is moved into the lambda and each function uses its own generator, all functions generate the same split point, depending on the seed. To get an actually random looking distribution of splits across functions, the work-function needs access to a shared random number generator. |
As a matter of preference - I try to wrap LLVM_DEBUG body with curly braces to indent it just like a regular code block.