]> git.lizzy.rs Git - rust.git/commit
Auto merge of #106908 - cjgillot:copyprop-ssa, r=oli-obk
authorbors <bors@rust-lang.org>
Sun, 29 Jan 2023 13:01:06 +0000 (13:01 +0000)
committerbors <bors@rust-lang.org>
Sun, 29 Jan 2023 13:01:06 +0000 (13:01 +0000)
commit2a4b00beaa208388c2f140866674605aceab0fe9
treea19eba4488f2e2e77a316d35c669a61f98f1ff55
parentd117135f5a9b69ee3adfb1918aa25616758bf692
parent263da251af6b1735487add274a4ed09487c69412
Auto merge of #106908 - cjgillot:copyprop-ssa, r=oli-obk

Implement simple CopyPropagation based on SSA analysis

This PR extracts the "copy propagation" logic from https://github.com/rust-lang/rust/pull/106285.

MIR may produce chains of assignment between locals, like `_x = move? _y`.
This PR attempts to remove such chains by unifying locals.

The current implementation is a bit overzealous in turning moves into copies, and in removing storage statements.
compiler/rustc_mir_transform/src/dest_prop.rs
compiler/rustc_mir_transform/src/lib.rs
compiler/rustc_mir_transform/src/simplify.rs