mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 02:33:55 +00:00
d2d24e395a
Account for immutably borrowed locals in MIR copy-prop and GVN For the most part, we consider that immutably borrowed `Freeze` locals still fulfill SSA conditions. As the borrow is immutable, any use of the local will have the value given by the single assignment, and there can be no surprise. This allows copy-prop to merge a non-borrowed local with a borrowed local. We chose to keep copy-classes heads unborrowed, as those may be easier to optimize in later passes. This also allows to GVN the value behind an immutable borrow. If a SSA local is borrowed, dereferencing that borrow is equivalent to copying the local's value: re-executing the assignment between the borrow and the dereference would be UB. r? `@ghost` for perf |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
messages.ftl |