rust/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.diff

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

76 lines
4.0 KiB
Diff
Raw Normal View History

- // MIR for `foo` before DestinationPropagation
+ // MIR for `foo` after DestinationPropagation
2020-05-24 14:37:09 -05:00
fn foo() -> i32 {
let mut _0: i32; // return place in scope 0 at $DIR/branch.rs:+0:13: +0:16
2022-07-27 13:47:42 -05:00
let _1: i32; // in scope 0 at $DIR/branch.rs:+1:9: +1:10
let mut _3: bool; // in scope 0 at $DIR/branch.rs:+3:16: +3:22
let _4: i32; // in scope 0 at $DIR/branch.rs:+6:9: +6:14
2020-05-24 14:37:09 -05:00
scope 1 {
- debug x => _1; // in scope 1 at $DIR/branch.rs:+1:9: +1:10
+ debug x => _0; // in scope 1 at $DIR/branch.rs:+1:9: +1:10
2022-07-27 13:47:42 -05:00
let _2: i32; // in scope 1 at $DIR/branch.rs:+3:9: +3:10
2020-05-24 14:37:09 -05:00
scope 2 {
- debug y => _2; // in scope 2 at $DIR/branch.rs:+3:9: +3:10
+ debug y => _0; // in scope 2 at $DIR/branch.rs:+3:9: +3:10
2020-05-24 14:37:09 -05:00
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/branch.rs:+1:9: +1:10
- _1 = val() -> bb1; // scope 0 at $DIR/branch.rs:+1:13: +1:18
+ nop; // scope 0 at $DIR/branch.rs:+1:9: +1:10
+ _0 = val() -> bb1; // scope 0 at $DIR/branch.rs:+1:13: +1:18
2020-05-24 14:37:09 -05:00
// mir::Constant
2023-04-05 03:44:20 -05:00
// + span: $DIR/branch.rs:14:13: 14:16
2022-07-06 09:14:46 -05:00
// + literal: Const { ty: fn() -> i32 {val}, val: Value(<ZST>) }
2020-05-24 14:37:09 -05:00
}
bb1: {
- StorageLive(_2); // scope 1 at $DIR/branch.rs:+3:9: +3:10
+ nop; // scope 1 at $DIR/branch.rs:+3:9: +3:10
2022-07-27 13:47:42 -05:00
StorageLive(_3); // scope 1 at $DIR/branch.rs:+3:16: +3:22
_3 = cond() -> bb2; // scope 1 at $DIR/branch.rs:+3:16: +3:22
2020-05-24 14:37:09 -05:00
// mir::Constant
2023-04-05 03:44:20 -05:00
// + span: $DIR/branch.rs:16:16: 16:20
2022-07-06 09:14:46 -05:00
// + literal: Const { ty: fn() -> bool {cond}, val: Value(<ZST>) }
2020-05-24 14:37:09 -05:00
}
bb2: {
switchInt(move _3) -> [0: bb4, otherwise: bb3]; // scope 1 at $DIR/branch.rs:+3:16: +3:22
2020-05-24 14:37:09 -05:00
}
bb3: {
- _2 = _1; // scope 1 at $DIR/branch.rs:+4:9: +4:10
+ nop; // scope 1 at $DIR/branch.rs:+4:9: +4:10
2022-07-27 13:47:42 -05:00
goto -> bb6; // scope 1 at $DIR/branch.rs:+3:13: +8:6
2021-01-01 12:38:11 -06:00
}
bb4: {
2022-07-27 13:47:42 -05:00
StorageLive(_4); // scope 1 at $DIR/branch.rs:+6:9: +6:14
_4 = val() -> bb5; // scope 1 at $DIR/branch.rs:+6:9: +6:14
2020-05-24 14:37:09 -05:00
// mir::Constant
2023-04-05 03:44:20 -05:00
// + span: $DIR/branch.rs:19:9: 19:12
2022-07-06 09:14:46 -05:00
// + literal: Const { ty: fn() -> i32 {val}, val: Value(<ZST>) }
2020-05-24 14:37:09 -05:00
}
bb5: {
2022-07-27 13:47:42 -05:00
StorageDead(_4); // scope 1 at $DIR/branch.rs:+6:14: +6:15
- _2 = _1; // scope 1 at $DIR/branch.rs:+7:9: +7:10
+ nop; // scope 1 at $DIR/branch.rs:+7:9: +7:10
2022-07-27 13:47:42 -05:00
goto -> bb6; // scope 1 at $DIR/branch.rs:+3:13: +8:6
2020-05-24 14:37:09 -05:00
}
bb6: {
2022-07-27 13:47:42 -05:00
StorageDead(_3); // scope 1 at $DIR/branch.rs:+8:5: +8:6
- _0 = _2; // scope 2 at $DIR/branch.rs:+10:5: +10:6
- StorageDead(_2); // scope 1 at $DIR/branch.rs:+11:1: +11:2
- StorageDead(_1); // scope 0 at $DIR/branch.rs:+11:1: +11:2
+ nop; // scope 2 at $DIR/branch.rs:+10:5: +10:6
+ nop; // scope 1 at $DIR/branch.rs:+11:1: +11:2
+ nop; // scope 0 at $DIR/branch.rs:+11:1: +11:2
return; // scope 0 at $DIR/branch.rs:+11:2: +11:2
2020-05-24 14:37:09 -05:00
}
}