-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
JIT: defer creating throw helper code until we know it's needed #104819
Conversation
Defer creation of throw helper code until the stack level setter analysis has\ determined the throw helper is needed. Defer finalizing the outgoing arg size as well. The throw helper support now goes through the steps: * early on phases can request that a throw helper block get created * we create the blocks (but not the code) before final block layout so they get proper placement * lowering adds references to throw helpers that are actually needed * stack level setter then materializes code for the needed helpers, and removes the blocks for the unneeded ones * we can then finalize the outgoing arg space size Closes dotnet#104658.
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
@jakobbotsch PTAL Some size improvements, no regressions. Oddly, some perf score regressions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Any idea how hard it would be to delay creating the BasicBlock
itself as well? We would need to fill in some liveness, but I wonder if there are any other problems with it.
We'd have to do some custom placement instead of relying on the main block layout algorithm. Or defer layout until later. |
I see, I didn't know we run the layout algorithm before lowering. I suppose the important part there is |
If the throw helper's block is assumed cold, then it should be pretty trivial to emulate |
My preference would be to have just one place that does all the layout logic. In particular once we start splitting, and if we're ever able to split EH regions, this stuff will get more involved. |
Got it, I still plan on exploring moving layout (and
I appreciate the commitment your usage of "once" implies |
Potential regression(s): @AndyAyersMS |
Defer creation of throw helper code until the stack level setter analysis has determined the throw helper is needed. Defer finalizing the outgoing arg size as well.
The throw helper support now goes through the steps:
Closes #104658.
Diffs