-
Notifications
You must be signed in to change notification settings - Fork 12.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
Make to_immediate/from_immediate configurable by backends #76071
Conversation
librustc_codegen_ssa has the concept of an immediate vs. memory type, and librustc_codegen_llvm uses this distinction to implement bools being i8 in memory, and i1 in immediate contexts. However, some of that implementation leaked into codegen_ssa when converting to/from immediate values. So, move those methods into builder traits, so that behavior can be configured by backends. This is useful if a backend is able to keep bools as bools, or, needs to do more trickery than just bools to bytes.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @davidtwco (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Hmm. CI is failing, I'm guessing I screwed up the bit of code around
which seems to imply that the I would try to debug it locally, but while
so I'm unable to debug the CI failure locally and figure out what's going on. |
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.
r=me with the pair field access fixed
r? @eddyb |
@bors r+ Thanks! |
📌 Commit 1663bfb has been approved by |
☔ The latest upstream changes (presumably #74862) made this pull request unmergeable. Please resolve the merge conflicts. |
☀️ Test successful - checks-actions, checks-azure |
librustc_codegen_ssa
has the concept of an immediate vs. memory type, andlibrustc_codegen_llvm
uses this distinction to implementbool
s beingi8
in memory, andi1
in immediate contexts. However, some of that implementation leaked intocodegen_ssa
when converting to/from immediate values. So, move those methods into builder traits, so that behavior can be configured by backends.This is useful if a backend is able to keep bools as bools, or, needs to do more trickery than just bools to bytes.
(Note that there's already a large amount of things abstracted with "immediate types" - this is just bringing this particular thing in line to be abstracted as well)
Pinging @eddyb since that's who I was talking about this change with when they suggested I submit a PR.