@@ -725,7 +725,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
725725            return  None ; 
726726        } 
727727
728-         if  self . tcx . sess . opts . debugging_opts . 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) ) 
@@ -903,7 +903,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
903903
904904    /// Returns `true` if and only if this `op` should be const-propagated into. 
905905     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 ( ) ; 
907907
908908        if  mir_opt_level == 0  { 
909909            return  false ; 
@@ -1071,9 +1071,9 @@ impl<'mir, 'tcx> MutVisitor<'tcx> for ConstPropagator<'mir, 'tcx> {
10711071    fn  visit_operand ( & mut  self ,  operand :  & mut  Operand < ' tcx > ,  location :  Location )  { 
10721072        self . super_operand ( operand,  location) ; 
10731073
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 
10751075        // 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  { 
10771077            self . propagate_operand ( operand) 
10781078        } 
10791079    } 
@@ -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. 
@@ -1272,7 +1272,7 @@ impl<'mir, 'tcx> MutVisitor<'tcx> for ConstPropagator<'mir, 'tcx> {
12721272            // Every argument in our function calls have already been propagated in `visit_operand`. 
12731273            // 
12741274            // 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 `. 
12761276            TerminatorKind :: Call  {  .. }  => { } 
12771277        } 
12781278
0 commit comments