about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDániel Buga <bugadani@gmail.com>2020-09-23 15:54:21 +0200
committerDániel Buga <bugadani@gmail.com>2020-09-23 19:03:10 +0200
commit90c7731f6cca6e4c741c5f465b307b4ac4a7f31f (patch)
tree662a51253062e271246cb577bcdcf10530e8f043
parentfeca2c229e209ceda1eda7306e6ea9ee0aaa9305 (diff)
downloadrust-90c7731f6cca6e4c741c5f465b307b4ac4a7f31f.tar.gz
rust-90c7731f6cca6e4c741c5f465b307b4ac4a7f31f.zip
Enable const prop into operands at mir_opt_level=2
-rw-r--r--compiler/rustc_mir/src/transform/const_prop.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_mir/src/transform/const_prop.rs b/compiler/rustc_mir/src/transform/const_prop.rs
index aa88719c26a..0f04ead94dd 100644
--- a/compiler/rustc_mir/src/transform/const_prop.rs
+++ b/compiler/rustc_mir/src/transform/const_prop.rs
@@ -1046,9 +1046,9 @@ impl<'mir, 'tcx> MutVisitor<'tcx> for ConstPropagator<'mir, 'tcx> {
     fn visit_operand(&mut self, operand: &mut Operand<'tcx>, location: Location) {
         self.super_operand(operand, location);
 
-        // Only const prop copies and moves on `mir_opt_level=3` as doing so
-        // currently increases compile time.
-        if self.tcx.sess.opts.debugging_opts.mir_opt_level >= 3 {
+        // Only const prop copies and moves on `mir_opt_level=2` as doing so
+        // currently slightly increases compile time in some cases.
+        if self.tcx.sess.opts.debugging_opts.mir_opt_level >= 2 {
             self.propagate_operand(operand)
         }
     }
@@ -1246,8 +1246,8 @@ impl<'mir, 'tcx> MutVisitor<'tcx> for ConstPropagator<'mir, 'tcx> {
             | TerminatorKind::InlineAsm { .. } => {}
             // Every argument in our function calls have already been propagated in `visit_operand`.
             //
-            // NOTE: because LLVM codegen gives performance regressions with it, so this is gated
-            // on `mir_opt_level=3`.
+            // NOTE: because LLVM codegen gives slight performance regressions with it, so this is
+            // gated on `mir_opt_level=2`.
             TerminatorKind::Call { .. } => {}
         }