New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] backend detects cold blocks and lays them out at end of function #92769
base: main
Are you sure you want to change the base?
Conversation
Would it better to add a warm
parameter to mark_reachable
?
mark_warm
, mark_cold
and mark_reachable
are all doing the same thing, except for which edges they follow.
Why does fall through from a cold block to a warm block need to be treated specially? Unless I'm mistaken: |
We can't change b->next of a block with a fallthrough. |
You could convert it to a jump and eliminate the fallthrough edge. |
That's the idea. But there could already be a conditional jump there, so if we don't want to have to worry about multiple jumps in the same block for the remaining parts of the assembler, it needs to be a new block. |
…gs calculated only once. don't pass compiler/assembler around as much
My first version did mark_cold/warm at the same time as mark_reachable. But I had a situation where the graph changed between that time and the time when I can do the push_cold_to_end. So now mark cold/warm happens just before push_cold_to_end. I could possibly share the code though. |
This version does the cold block detection through control flow. Currently excluding two cases that need to be fixed: