about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2023-02-07 19:24:21 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2023-07-20 21:30:51 +0000
commit12a2edd1498044eb06a722409a399ea7cc35d9df (patch)
tree2a756a2d1d1c14d44473115e9ce334c0fa553aa4 /compiler/rustc_mir_transform/src
parent1554942cdc0099e081d5cd673d45f8a09cfd0eb0 (diff)
downloadrust-12a2edd1498044eb06a722409a399ea7cc35d9df.tar.gz
rust-12a2edd1498044eb06a722409a399ea7cc35d9df.zip
Always propagate into operands.
Diffstat (limited to 'compiler/rustc_mir_transform/src')
-rw-r--r--compiler/rustc_mir_transform/src/const_prop.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/compiler/rustc_mir_transform/src/const_prop.rs b/compiler/rustc_mir_transform/src/const_prop.rs
index 6437a227d47..da6ccf21144 100644
--- a/compiler/rustc_mir_transform/src/const_prop.rs
+++ b/compiler/rustc_mir_transform/src/const_prop.rs
@@ -810,12 +810,7 @@ impl<'tcx> MutVisitor<'tcx> for ConstPropagator<'_, '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 slightly increases compile time in some cases.
-        if self.tcx.sess.mir_opt_level() >= 3 {
-            self.propagate_operand(operand)
-        }
+        self.propagate_operand(operand)
     }
 
     fn process_projection_elem(