-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Improve handling of immediate values #27600
Conversation
r? @jroesch (rust_highfive has picked a reviewer for you, use r? to override) |
} | ||
} else { | ||
llresult = C_nil(bcx.ccx()); | ||
} |
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.
I'd prefer to add that check after the if-else block, so it can be merged with the same one in the else-arm.
👍 I wanted to get rid of the store/load combo for function calls for sooooo long. I'm not sure about the load elision thing. How often / in which situations does that come into play? |
Neat. Do compile times improve? |
The primary improvement here is to handle function calls that return imemdiate values such that it doesn't force the use of a stack slot. It also avoids loads from slots that have an store to it in the same block. This especially improves the codegen for intrinsics, as most of them produce immediate values.
* Move the "get the value that will definitely be loaded" logic to it's own method to reduce the duplication. * Refactor base::invoke to avoid duplicating the diverging/zero-sized return logic. * Re-add debugging output I accidentally removed * Add some more comments explaining stuff
707db64
to
8905343
Compare
Updated to address comments. @brson I haven't tested, but my previous attempt at this suggested, no. At least, nothing that isn't covered by noise. The main reason presumably being that |
@Aatch read the patch over and it looks good to me, not sure if you want someone who spends more time in trans to look it over instead, otherwise r=me. |
⌛ Testing commit 8905343 with merge 924bd8b... |
💔 Test failed - auto-mac-64-nopt-t |
☔ The latest upstream changes (presumably #27169) made this pull request unmergeable. Please resolve the merge conflicts. |
@Aatch ping, whats the status on this? |
@Aatch Are you ok with me finishing this in a new PR? |
The primary improvement here is to handle function calls that return
imemdiate values such that it doesn't force the use of a stack slot. It
also avoids loads from slots that have an store to it in the same block.
This especially improves the codegen for intrinsics, as most of them
produce immediate values.
cc @rust-lang/compiler