Skip to content

Commit 90c7731

Browse files
committed
Enable const prop into operands at mir_opt_level=2
1 parent feca2c2 commit 90c7731

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

compiler/rustc_mir/src/transform/const_prop.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1046,9 +1046,9 @@ impl<'mir, 'tcx> MutVisitor<'tcx> for ConstPropagator<'mir, 'tcx> {
10461046
fn visit_operand(&mut self, operand: &mut Operand<'tcx>, location: Location) {
10471047
self.super_operand(operand, location);
10481048

1049-
// Only const prop copies and moves on `mir_opt_level=3` as doing so
1050-
// currently increases compile time.
1051-
if self.tcx.sess.opts.debugging_opts.mir_opt_level >= 3 {
1049+
// Only const prop copies and moves on `mir_opt_level=2` as doing so
1050+
// currently slightly increases compile time in some cases.
1051+
if self.tcx.sess.opts.debugging_opts.mir_opt_level >= 2 {
10521052
self.propagate_operand(operand)
10531053
}
10541054
}
@@ -1246,8 +1246,8 @@ impl<'mir, 'tcx> MutVisitor<'tcx> for ConstPropagator<'mir, 'tcx> {
12461246
| TerminatorKind::InlineAsm { .. } => {}
12471247
// Every argument in our function calls have already been propagated in `visit_operand`.
12481248
//
1249-
// NOTE: because LLVM codegen gives performance regressions with it, so this is gated
1250-
// on `mir_opt_level=3`.
1249+
// NOTE: because LLVM codegen gives slight performance regressions with it, so this is
1250+
// gated on `mir_opt_level=2`.
12511251
TerminatorKind::Call { .. } => {}
12521252
}
12531253

0 commit comments

Comments
 (0)