mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 14:31:55 +00:00
Enable the SimplifyArmIdentity MIR optimization at mir-opt-level=1
This commit is contained in:
parent
0d0f6b1130
commit
903c0399e7
@ -367,11 +367,7 @@ fn optimization_applies<'tcx>(
|
||||
}
|
||||
|
||||
impl<'tcx> MirPass<'tcx> for SimplifyArmIdentity {
|
||||
fn run_pass(&self, tcx: TyCtxt<'tcx>, source: MirSource<'tcx>, body: &mut Body<'tcx>) {
|
||||
if tcx.sess.opts.debugging_opts.mir_opt_level < 2 {
|
||||
return;
|
||||
}
|
||||
|
||||
fn run_pass(&self, _tcx: TyCtxt<'tcx>, source: MirSource<'tcx>, body: &mut Body<'tcx>) {
|
||||
trace!("running SimplifyArmIdentity on {:?}", source);
|
||||
let local_uses = LocalUseCounter::get_local_uses(body);
|
||||
let (basic_blocks, local_decls, debug_info) =
|
||||
|
@ -18,7 +18,8 @@
|
||||
debug tail => _4; // in scope 1 at $DIR/simplify_try_if_let.rs:23:18: 23:26
|
||||
let _8: std::ptr::NonNull<Node>; // in scope 1 at $DIR/simplify_try_if_let.rs:26:29: 26:39
|
||||
scope 2 {
|
||||
debug other_head => _8; // in scope 2 at $DIR/simplify_try_if_let.rs:26:29: 26:39
|
||||
- debug other_head => _8; // in scope 2 at $DIR/simplify_try_if_let.rs:26:29: 26:39
|
||||
+ debug other_head => ((_9 as Some).0: std::ptr::NonNull<Node>); // in scope 2 at $DIR/simplify_try_if_let.rs:26:29: 26:39
|
||||
scope 3 {
|
||||
}
|
||||
}
|
||||
@ -65,11 +66,12 @@
|
||||
StorageLive(_8); // scope 1 at $DIR/simplify_try_if_let.rs:26:29: 26:39
|
||||
_8 = ((_5 as Some).0: std::ptr::NonNull<Node>); // scope 1 at $DIR/simplify_try_if_let.rs:26:29: 26:39
|
||||
StorageLive(_9); // scope 3 at $DIR/simplify_try_if_let.rs:28:46: 28:62
|
||||
StorageLive(_10); // scope 3 at $DIR/simplify_try_if_let.rs:28:51: 28:61
|
||||
_10 = _8; // scope 3 at $DIR/simplify_try_if_let.rs:28:51: 28:61
|
||||
((_9 as Some).0: std::ptr::NonNull<Node>) = move _10; // scope 3 at $DIR/simplify_try_if_let.rs:28:46: 28:62
|
||||
discriminant(_9) = 1; // scope 3 at $DIR/simplify_try_if_let.rs:28:46: 28:62
|
||||
StorageDead(_10); // scope 3 at $DIR/simplify_try_if_let.rs:28:61: 28:62
|
||||
- StorageLive(_10); // scope 3 at $DIR/simplify_try_if_let.rs:28:51: 28:61
|
||||
- _10 = _8; // scope 3 at $DIR/simplify_try_if_let.rs:28:51: 28:61
|
||||
- ((_9 as Some).0: std::ptr::NonNull<Node>) = move _10; // scope 3 at $DIR/simplify_try_if_let.rs:28:46: 28:62
|
||||
- discriminant(_9) = 1; // scope 3 at $DIR/simplify_try_if_let.rs:28:46: 28:62
|
||||
- StorageDead(_10); // scope 3 at $DIR/simplify_try_if_let.rs:28:61: 28:62
|
||||
+ _9 = move _5; // scope 3 at $DIR/simplify_try_if_let.rs:28:46: 28:62
|
||||
StorageLive(_11); // scope 3 at $DIR/simplify_try_if_let.rs:28:25: 28:38
|
||||
StorageLive(_12); // scope 3 at $DIR/simplify_try_if_let.rs:28:25: 28:29
|
||||
_12 = &mut _4; // scope 3 at $DIR/simplify_try_if_let.rs:28:25: 28:29
|
||||
|
Loading…
Reference in New Issue
Block a user