@@ -582,7 +582,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
582
582
Some ( ( ) )
583
583
}
584
584
585
- fn propagate_operand ( & mut self , operand : & mut Operand < ' tcx > , location : Location ) {
585
+ fn propagate_operand ( & mut self , operand : & mut Operand < ' tcx > ) {
586
586
match * operand {
587
587
Operand :: Copy ( l) | Operand :: Move ( l) => {
588
588
if let Some ( value) = self . get_const ( l) {
@@ -606,7 +606,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
606
606
}
607
607
}
608
608
}
609
- Operand :: Constant ( ref mut ct ) => self . visit_constant ( ct , location ) ,
609
+ Operand :: Constant ( _ ) => ( ) ,
610
610
}
611
611
}
612
612
@@ -934,12 +934,12 @@ impl<'mir, 'tcx> MutVisitor<'tcx> for ConstPropagator<'mir, 'tcx> {
934
934
}
935
935
936
936
fn visit_operand ( & mut self , operand : & mut Operand < ' tcx > , location : Location ) {
937
+ self . super_operand ( operand, location) ;
938
+
937
939
// Only const prop copies and moves on `mir_opt_level=3` as doing so
938
940
// currently increases compile time.
939
- if self . tcx . sess . opts . debugging_opts . mir_opt_level < 3 {
940
- self . super_operand ( operand, location)
941
- } else {
942
- self . propagate_operand ( operand, location)
941
+ if self . tcx . sess . opts . debugging_opts . mir_opt_level >= 3 {
942
+ self . propagate_operand ( operand)
943
943
}
944
944
}
945
945
@@ -1114,7 +1114,7 @@ impl<'mir, 'tcx> MutVisitor<'tcx> for ConstPropagator<'mir, 'tcx> {
1114
1114
// FIXME: This is currently redundant with `visit_operand`, but sadly
1115
1115
// always visiting operands currently causes a perf regression in LLVM codegen, so
1116
1116
// `visit_operand` currently only runs for propagates places for `mir_opt_level=3`.
1117
- self . propagate_operand ( discr, location )
1117
+ self . propagate_operand ( discr)
1118
1118
}
1119
1119
// None of these have Operands to const-propagate.
1120
1120
TerminatorKind :: Goto { .. }
0 commit comments