1
Fork 0

Always take advantage of arithmetic identities

This commit is contained in:
Ben Kimock 2023-01-01 15:02:51 -05:00
parent 574b64a97f
commit 82f0973dd5
4 changed files with 47 additions and 5 deletions

View file

@ -655,11 +655,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
return None;
}
if self.tcx.sess.mir_opt_level() >= 4 {
self.eval_rvalue_with_identities(rvalue, place)
} else {
self.use_ecx(|this| this.ecx.eval_rvalue_into_place(rvalue, place))
}
self.eval_rvalue_with_identities(rvalue, place)
}
// Attempt to use algebraic identities to eliminate constant expressions