@@ -725,7 +725,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
725
725
return None ;
726
726
}
727
727
728
- if self . tcx . sess . opts . debugging_opts . mir_opt_level >= 3 {
728
+ if self . tcx . sess . mir_opt_level ( ) >= 4 {
729
729
self . eval_rvalue_with_identities ( rvalue, place)
730
730
} else {
731
731
self . use_ecx ( |this| this. ecx . eval_rvalue_into_place ( rvalue, place) )
@@ -903,7 +903,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
903
903
904
904
/// Returns `true` if and only if this `op` should be const-propagated into.
905
905
fn should_const_prop ( & mut self , op : & OpTy < ' tcx > ) -> bool {
906
- let mir_opt_level = self . tcx . sess . opts . debugging_opts . mir_opt_level ;
906
+ let mir_opt_level = self . tcx . sess . mir_opt_level ( ) ;
907
907
908
908
if mir_opt_level == 0 {
909
909
return false ;
@@ -1071,9 +1071,9 @@ impl<'mir, 'tcx> MutVisitor<'tcx> for ConstPropagator<'mir, 'tcx> {
1071
1071
fn visit_operand ( & mut self , operand : & mut Operand < ' tcx > , location : Location ) {
1072
1072
self . super_operand ( operand, location) ;
1073
1073
1074
- // Only const prop copies and moves on `mir_opt_level=2 ` as doing so
1074
+ // Only const prop copies and moves on `mir_opt_level=3 ` as doing so
1075
1075
// currently slightly increases compile time in some cases.
1076
- if self . tcx . sess . opts . debugging_opts . mir_opt_level >= 2 {
1076
+ if self . tcx . sess . mir_opt_level ( ) >= 3 {
1077
1077
self . propagate_operand ( operand)
1078
1078
}
1079
1079
}
@@ -1253,7 +1253,7 @@ impl<'mir, 'tcx> MutVisitor<'tcx> for ConstPropagator<'mir, 'tcx> {
1253
1253
TerminatorKind :: SwitchInt { ref mut discr, .. } => {
1254
1254
// FIXME: This is currently redundant with `visit_operand`, but sadly
1255
1255
// 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 `.
1257
1257
self . propagate_operand ( discr)
1258
1258
}
1259
1259
// None of these have Operands to const-propagate.
@@ -1272,7 +1272,7 @@ impl<'mir, 'tcx> MutVisitor<'tcx> for ConstPropagator<'mir, 'tcx> {
1272
1272
// Every argument in our function calls have already been propagated in `visit_operand`.
1273
1273
//
1274
1274
// NOTE: because LLVM codegen gives slight performance regressions with it, so this is
1275
- // gated on `mir_opt_level=2 `.
1275
+ // gated on `mir_opt_level=3 `.
1276
1276
TerminatorKind :: Call { .. } => { }
1277
1277
}
1278
1278
0 commit comments