1
Fork 0

Bump all mir_opt_level 3 to 4

This commit is contained in:
Santiago Pastorino 2021-03-03 18:30:42 -03:00
parent fde8d6ee81
commit f3b8920d4b
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF
5 changed files with 7 additions and 7 deletions

View file

@ -28,7 +28,7 @@ pub struct ConstGoto;
impl<'tcx> MirPass<'tcx> for ConstGoto { impl<'tcx> MirPass<'tcx> for ConstGoto {
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
if tcx.sess.mir_opt_level() < 3 { if tcx.sess.mir_opt_level() < 4 {
return; return;
} }
trace!("Running ConstGoto on {:?}", body.source); trace!("Running ConstGoto on {:?}", body.source);

View file

@ -725,7 +725,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
return None; return None;
} }
if self.tcx.sess.mir_opt_level() >= 3 { if self.tcx.sess.mir_opt_level() >= 4 {
self.eval_rvalue_with_identities(rvalue, place) self.eval_rvalue_with_identities(rvalue, place)
} else { } else {
self.use_ecx(|this| this.ecx.eval_rvalue_into_place(rvalue, place)) 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> {
TerminatorKind::SwitchInt { ref mut discr, .. } => { TerminatorKind::SwitchInt { ref mut discr, .. } => {
// FIXME: This is currently redundant with `visit_operand`, but sadly // FIXME: This is currently redundant with `visit_operand`, but sadly
// always visiting operands currently causes a perf regression in LLVM codegen, so // always visiting operands currently causes a perf regression in LLVM codegen, so
// `visit_operand` currently only runs for propagates places for `mir_opt_level=3`. // `visit_operand` currently only runs for propagates places for `mir_opt_level=4`.
self.propagate_operand(discr) self.propagate_operand(discr)
} }
// None of these have Operands to const-propagate. // None of these have Operands to const-propagate.

View file

@ -16,7 +16,7 @@ pub struct DeduplicateBlocks;
impl<'tcx> MirPass<'tcx> for DeduplicateBlocks { impl<'tcx> MirPass<'tcx> for DeduplicateBlocks {
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
if tcx.sess.mir_opt_level() < 3 { if tcx.sess.mir_opt_level() < 4 {
return; return;
} }
debug!("Running DeduplicateBlocks on `{:?}`", body.source); debug!("Running DeduplicateBlocks on `{:?}`", body.source);

View file

@ -10,7 +10,7 @@ pub struct MultipleReturnTerminators;
impl<'tcx> MirPass<'tcx> for MultipleReturnTerminators { impl<'tcx> MirPass<'tcx> for MultipleReturnTerminators {
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
if tcx.sess.mir_opt_level() < 3 { if tcx.sess.mir_opt_level() < 4 {
return; return;
} }

View file

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