diff options
| author | Jonas Schievink <jonasschievink@gmail.com> | 2020-10-04 15:45:50 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-04 15:45:50 +0200 |
| commit | fa200cec889b2b2308882a897cafe92bf1cf13c7 (patch) | |
| tree | 686f88df57cab7207ece45e3678c0b262a292f4f /compiler | |
| parent | 5889cf314655a0d62f7e776c15ecd33cc20915bb (diff) | |
| parent | 59c243331d60e74290102d5450587adf58597dd5 (diff) | |
Rollup merge of #77525 - tmiasko:nrvo-2, r=jonas-schievink
Enable RenameReturnPlace MIR optimization on mir-opt-level >= 2 The destination propagation as currently implemented does not supersede the NRVO, e.g., the destination propagation never applies if either local has an address taken, while NRVO might. Additionally, the issue with failing assertions had been already resolved. Continue running both optimizations at mir-opt-level >= 2.
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_mir/src/transform/nrvo.rs | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/compiler/rustc_mir/src/transform/nrvo.rs b/compiler/rustc_mir/src/transform/nrvo.rs index 1ffb5a87c47..3673b6a4aa2 100644 --- a/compiler/rustc_mir/src/transform/nrvo.rs +++ b/compiler/rustc_mir/src/transform/nrvo.rs @@ -36,12 +36,6 @@ impl<'tcx> MirPass<'tcx> for RenameReturnPlace { return; } - if tcx.sess.opts.debugging_opts.mir_opt_level >= 2 { - // The `DestinationPropagation` pass runs at level 2, so this pass is redundant (and - // fails some asserts). - return; - } - let returned_local = match local_eligible_for_nrvo(body) { Some(l) => l, None => { |
