From f3b8920d4bcd9cc55ea2b5041f4341c1337933f8 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Wed, 3 Mar 2021 18:30:42 -0300 Subject: [PATCH] Bump all mir_opt_level 3 to 4 --- compiler/rustc_mir/src/transform/const_goto.rs | 2 +- compiler/rustc_mir/src/transform/const_prop.rs | 4 ++-- compiler/rustc_mir/src/transform/deduplicate_blocks.rs | 2 +- .../rustc_mir/src/transform/multiple_return_terminators.rs | 2 +- compiler/rustc_mir/src/transform/unreachable_prop.rs | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/compiler/rustc_mir/src/transform/const_goto.rs b/compiler/rustc_mir/src/transform/const_goto.rs index 522f7ddd8cd..b5c8b4bebc3 100644 --- a/compiler/rustc_mir/src/transform/const_goto.rs +++ b/compiler/rustc_mir/src/transform/const_goto.rs @@ -28,7 +28,7 @@ impl<'tcx> MirPass<'tcx> for ConstGoto { fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { - if tcx.sess.mir_opt_level() < 3 { + if tcx.sess.mir_opt_level() < 4 { return; } trace!("Running ConstGoto on {:?}", body.source); diff --git a/compiler/rustc_mir/src/transform/const_prop.rs b/compiler/rustc_mir/src/transform/const_prop.rs index 2fdd55626ef..e5fb0e597c0 100644 --- a/compiler/rustc_mir/src/transform/const_prop.rs +++ b/compiler/rustc_mir/src/transform/const_prop.rs @@ -725,7 +725,7 @@ fn const_prop( return None; } - if self.tcx.sess.mir_opt_level() >= 3 { + if self.tcx.sess.mir_opt_level() >= 4 { self.eval_rvalue_with_identities(rvalue, place) } else { self.use_ecx(|this| this.ecx.eval_rvalue_into_place(rvalue, place)) @@ -1253,7 +1253,7 @@ fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { TerminatorKind::SwitchInt { ref mut discr, .. } => { // FIXME: This is currently redundant with `visit_operand`, but sadly // always visiting operands currently causes a perf regression in LLVM codegen, so - // `visit_operand` currently only runs for propagates places for `mir_opt_level=3`. + // `visit_operand` currently only runs for propagates places for `mir_opt_level=4`. self.propagate_operand(discr) } // None of these have Operands to const-propagate. diff --git a/compiler/rustc_mir/src/transform/deduplicate_blocks.rs b/compiler/rustc_mir/src/transform/deduplicate_blocks.rs index ed2ff4fde9e..c4b51099f53 100644 --- a/compiler/rustc_mir/src/transform/deduplicate_blocks.rs +++ b/compiler/rustc_mir/src/transform/deduplicate_blocks.rs @@ -16,7 +16,7 @@ impl<'tcx> MirPass<'tcx> for DeduplicateBlocks { fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { - if tcx.sess.mir_opt_level() < 3 { + if tcx.sess.mir_opt_level() < 4 { return; } debug!("Running DeduplicateBlocks on `{:?}`", body.source); diff --git a/compiler/rustc_mir/src/transform/multiple_return_terminators.rs b/compiler/rustc_mir/src/transform/multiple_return_terminators.rs index 0f5b080d483..4aaa0baa9f4 100644 --- a/compiler/rustc_mir/src/transform/multiple_return_terminators.rs +++ b/compiler/rustc_mir/src/transform/multiple_return_terminators.rs @@ -10,7 +10,7 @@ impl<'tcx> MirPass<'tcx> for MultipleReturnTerminators { fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { - if tcx.sess.mir_opt_level() < 3 { + if tcx.sess.mir_opt_level() < 4 { return; } diff --git a/compiler/rustc_mir/src/transform/unreachable_prop.rs b/compiler/rustc_mir/src/transform/unreachable_prop.rs index dbb2d3ded6e..658c6b6e9db 100644 --- a/compiler/rustc_mir/src/transform/unreachable_prop.rs +++ b/compiler/rustc_mir/src/transform/unreachable_prop.rs @@ -12,8 +12,8 @@ impl MirPass<'_> for UnreachablePropagation { fn run_pass<'tcx>(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { - if tcx.sess.mir_opt_level() < 3 { - // Enable only under -Zmir-opt-level=3 as in some cases (check the deeply-nested-opt + if tcx.sess.mir_opt_level() < 4 { + // Enable only under -Zmir-opt-level=4 as in some cases (check the deeply-nested-opt // perf benchmark) LLVM may spend quite a lot of time optimizing the generated code. return; } -- GitLab