1
Fork 0

Enable CopyProp by default, tune the impl a bit

This commit is contained in:
Ben Kimock 2023-01-29 13:50:33 -05:00
parent 8dabf5da9e
commit 640ede7b0a
14 changed files with 248 additions and 174 deletions

View file

@ -22,7 +22,7 @@ pub struct CopyProp;
impl<'tcx> MirPass<'tcx> for CopyProp {
fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
sess.mir_opt_level() >= 4
sess.mir_opt_level() >= 1
}
#[instrument(level = "trace", skip(self, tcx, body))]
@ -96,7 +96,7 @@ fn fully_moved_locals(ssa: &SsaLocals, body: &Body<'_>) -> BitSet<Local> {
fully_moved
}
/// Utility to help performing subtitution of `*pattern` by `target`.
/// Utility to help performing substitution of `*pattern` by `target`.
struct Replacer<'a, 'tcx> {
tcx: TyCtxt<'tcx>,
fully_moved: BitSet<Local>,