Skip to content
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

Don't drop Rvalue::WrapUnsafeBinder during GVN #137864

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Mar 1, 2025

...and instead use Value::WrapUnsafeBinder to properly propagate consts through wrap_binder!() in GVN.

Fixes #137846

r? oli-obk

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 1, 2025
@rust-log-analyzer

This comment has been minimized.

@compiler-errors compiler-errors marked this pull request as ready for review March 4, 2025 17:35
@rustbot
Copy link
Collaborator

rustbot commented Mar 4, 2025

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

return self.simplify_operand(op, location);
Rvalue::WrapUnsafeBinder(ref mut op, ty) => {
let value = self.simplify_operand(op, location)?;
Value::WrapUnsafeBinder(value, ty)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just produce a transmute cast?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

o true :3 that works

@oli-obk oli-obk added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 10, 2025
@oli-obk
Copy link
Contributor

oli-obk commented Mar 10, 2025

r=me with WrapUnsafeBinder removed

@tmiasko
Copy link
Contributor

tmiasko commented Mar 11, 2025

Is there a reason why we can't use transmute lowering generally in runtime MIR?

@oli-obk
Copy link
Contributor

oli-obk commented Mar 11, 2025

errs tried it out and it didn't actually simplify things

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

assertion hit in GVN with unsafe binder
5 participants