-
Notifications
You must be signed in to change notification settings - Fork 13.9k
GVN: Only introduce new derefs if the immutable borrow is always valid. #147886
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
base: master
Are you sure you want to change the base?
Conversation
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
/// Check that we allow dereferences in the RHS if the LHS is a stable projection. | ||
// This introduces copy overlapping if dereferencing `_2` or `_4`. | ||
#[custom_mir(dialect = "runtime")] | ||
fn stable_projection(_1: (Adt,)) { |
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.
@cjgillot I just found this still introduces copy overlapping.
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
GVN: Only introduce new derefs if the immutable borrow is always valid.
This comment has been minimized.
This comment has been minimized.
I'd have kept introducing |
Queued efb5f98 with parent c6efb90, future comparison URL. |
Fixes #141313 and #141313 (comment).
I agree with what #147844 (comment) mentioned:
I don't think we should ban introducing new derefs, since this may prevent many optimizations.
r? cjgillot