From 782c7b04cf7a815890fc0bb50ad721081779d0a5 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Wed, 3 Mar 2021 18:56:00 -0300 Subject: [PATCH] Bump all mir_opt_level 2 to 3 --- compiler/rustc_mir/src/transform/const_prop.rs | 4 ++-- compiler/rustc_mir/src/transform/dest_prop.rs | 4 ++-- compiler/rustc_mir/src/transform/early_otherwise_branch.rs | 2 +- compiler/rustc_mir/src/transform/inline.rs | 2 +- compiler/rustc_mir/src/transform/match_branches.rs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/compiler/rustc_mir/src/transform/const_prop.rs b/compiler/rustc_mir/src/transform/const_prop.rs index e5fb0e597c0..5196b40c8c7 100644 --- a/compiler/rustc_mir/src/transform/const_prop.rs +++ b/compiler/rustc_mir/src/transform/const_prop.rs @@ -1071,9 +1071,9 @@ impl<'mir, 'tcx> MutVisitor<'tcx> for ConstPropagator<'mir, 'tcx> { fn visit_operand(&mut self, operand: &mut Operand<'tcx>, location: Location) { self.super_operand(operand, location); - // Only const prop copies and moves on `mir_opt_level=2` as doing so + // Only const prop copies and moves on `mir_opt_level=3` as doing so // currently slightly increases compile time in some cases. - if self.tcx.sess.mir_opt_level() >= 2 { + if self.tcx.sess.mir_opt_level() >= 3 { self.propagate_operand(operand) } } diff --git a/compiler/rustc_mir/src/transform/dest_prop.rs b/compiler/rustc_mir/src/transform/dest_prop.rs index 305d9426c18..0822ab73c4c 100644 --- a/compiler/rustc_mir/src/transform/dest_prop.rs +++ b/compiler/rustc_mir/src/transform/dest_prop.rs @@ -127,9 +127,9 @@ pub struct DestinationPropagation; impl<'tcx> MirPass<'tcx> for DestinationPropagation { fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { - // Only run at mir-opt-level=2 or higher for now (we don't fix up debuginfo and remove + // Only run at mir-opt-level=3 or higher for now (we don't fix up debuginfo and remove // storage statements at the moment). - if tcx.sess.mir_opt_level() < 2 { + if tcx.sess.mir_opt_level() < 3 { return; } diff --git a/compiler/rustc_mir/src/transform/early_otherwise_branch.rs b/compiler/rustc_mir/src/transform/early_otherwise_branch.rs index ae9a1ed4680..821167fd9f0 100644 --- a/compiler/rustc_mir/src/transform/early_otherwise_branch.rs +++ b/compiler/rustc_mir/src/transform/early_otherwise_branch.rs @@ -26,7 +26,7 @@ pub struct EarlyOtherwiseBranch; impl<'tcx> MirPass<'tcx> for EarlyOtherwiseBranch { fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { - if tcx.sess.mir_opt_level() < 2 { + if tcx.sess.mir_opt_level() < 3 { return; } trace!("running EarlyOtherwiseBranch on {:?}", body.source); diff --git a/compiler/rustc_mir/src/transform/inline.rs b/compiler/rustc_mir/src/transform/inline.rs index d07c141561a..cf85503b3d5 100644 --- a/compiler/rustc_mir/src/transform/inline.rs +++ b/compiler/rustc_mir/src/transform/inline.rs @@ -52,7 +52,7 @@ crate fn is_enabled(tcx: TyCtxt<'_>) -> bool { return enabled; } - tcx.sess.mir_opt_level() >= 2 + tcx.sess.mir_opt_level() >= 3 } impl<'tcx> MirPass<'tcx> for Inline { diff --git a/compiler/rustc_mir/src/transform/match_branches.rs b/compiler/rustc_mir/src/transform/match_branches.rs index deb9c3d3d4b..e254f0553aa 100644 --- a/compiler/rustc_mir/src/transform/match_branches.rs +++ b/compiler/rustc_mir/src/transform/match_branches.rs @@ -40,7 +40,7 @@ pub struct MatchBranchSimplification; impl<'tcx> MirPass<'tcx> for MatchBranchSimplification { fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { - if tcx.sess.mir_opt_level() < 2 { + if tcx.sess.mir_opt_level() < 3 { return; }