Skip to content

Commit b5da6f8

Browse files
committed
Bump all mir_opt_level 3 to 4
1 parent c86b7b4 commit b5da6f8

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

compiler/rustc_mir/src/transform/const_goto.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub struct ConstGoto;
2828

2929
impl<'tcx> MirPass<'tcx> for ConstGoto {
3030
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
31-
if tcx.sess.mir_opt_level() < 3 {
31+
if tcx.sess.mir_opt_level() < 4 {
3232
return;
3333
}
3434
trace!("Running ConstGoto on {:?}", body.source);

compiler/rustc_mir/src/transform/const_prop.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
725725
return None;
726726
}
727727

728-
if self.tcx.sess.mir_opt_level() >= 3 {
728+
if self.tcx.sess.mir_opt_level() >= 4 {
729729
self.eval_rvalue_with_identities(rvalue, place)
730730
} else {
731731
self.use_ecx(|this| this.ecx.eval_rvalue_into_place(rvalue, place))
@@ -1253,7 +1253,7 @@ impl<'mir, 'tcx> MutVisitor<'tcx> for ConstPropagator<'mir, 'tcx> {
12531253
TerminatorKind::SwitchInt { ref mut discr, .. } => {
12541254
// FIXME: This is currently redundant with `visit_operand`, but sadly
12551255
// always visiting operands currently causes a perf regression in LLVM codegen, so
1256-
// `visit_operand` currently only runs for propagates places for `mir_opt_level=3`.
1256+
// `visit_operand` currently only runs for propagates places for `mir_opt_level=4`.
12571257
self.propagate_operand(discr)
12581258
}
12591259
// None of these have Operands to const-propagate.

compiler/rustc_mir/src/transform/deduplicate_blocks.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub struct DeduplicateBlocks;
1616

1717
impl<'tcx> MirPass<'tcx> for DeduplicateBlocks {
1818
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
19-
if tcx.sess.mir_opt_level() < 3 {
19+
if tcx.sess.mir_opt_level() < 4 {
2020
return;
2121
}
2222
debug!("Running DeduplicateBlocks on `{:?}`", body.source);

compiler/rustc_mir/src/transform/multiple_return_terminators.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub struct MultipleReturnTerminators;
1010

1111
impl<'tcx> MirPass<'tcx> for MultipleReturnTerminators {
1212
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
13-
if tcx.sess.mir_opt_level() < 3 {
13+
if tcx.sess.mir_opt_level() < 4 {
1414
return;
1515
}
1616

compiler/rustc_mir/src/transform/unreachable_prop.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ pub struct UnreachablePropagation;
1212

1313
impl MirPass<'_> for UnreachablePropagation {
1414
fn run_pass<'tcx>(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
15-
if tcx.sess.mir_opt_level() < 3 {
16-
// Enable only under -Zmir-opt-level=3 as in some cases (check the deeply-nested-opt
15+
if tcx.sess.mir_opt_level() < 4 {
16+
// Enable only under -Zmir-opt-level=4 as in some cases (check the deeply-nested-opt
1717
// perf benchmark) LLVM may spend quite a lot of time optimizing the generated code.
1818
return;
1919
}

0 commit comments

Comments
 (0)