We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 87104ba commit ce2e3e0Copy full SHA for ce2e3e0
compiler/rustc_mir_transform/src/gvn.rs
@@ -741,7 +741,6 @@ impl<'tcx> MutVisitor<'tcx> for VnState<'_, 'tcx> {
741
}
742
743
fn visit_statement(&mut self, stmt: &mut Statement<'tcx>, location: Location) {
744
- self.super_statement(stmt, location);
745
if let StatementKind::Assign(box (_, ref mut rvalue)) = stmt.kind
746
// Do not try to simplify a constant, it's already in canonical shape.
747
&& !matches!(rvalue, Rvalue::Use(Operand::Constant(_)))
@@ -755,6 +754,8 @@ impl<'tcx> MutVisitor<'tcx> for VnState<'_, 'tcx> {
755
754
*rvalue = Rvalue::Use(Operand::Copy(local.into()));
756
self.reused_locals.insert(local);
757
+ } else {
758
+ self.super_statement(stmt, location);
759
760
761
0 commit comments