Skip to content

Commit 255a4c5

Browse files
committed
Auto merge of #72632 - jonas-schievink:dest-prop, r=oli-obk
Implement a generic Destination Propagation optimization on MIR This takes the work that was originally started by `@eddyb` in #47954, and then explored by me in #71003, and implements it in a general (ie. not limited to acyclic CFGs) and dataflow-driven way (so that no additional infrastructure in rustc is needed). The pass is configured to run at `mir-opt-level=2` and higher only. To enable it by default, some followup work on it is still needed: * Performance needs to be evaluated. I did some light optimization work and tested against `tuple-stress`, which caused trouble in my last attempt, but didn't go much in depth here. * We can also enable the pass only at `opt-level=2` and higher, if it is too slow to run in debug mode, but fine when optimizations run anyways. * Debuginfo needs to be fixed after locals are merged. I did not look into what is required for this. * Live ranges of locals (aka `StorageLive` and `StorageDead`) are currently deleted. We either need to decide that this is fine, or if not, merge the variable's live ranges (or remove these statements entirely – #68622). Some benchmarks of the pass were done in #72635.
2 parents f68e089 + 2f9271b commit 255a4c5

35 files changed

+1919
-456
lines changed

compiler/rustc_mir/src/dataflow/impls/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ impl<'a, 'tcx> HasMoveData<'tcx> for DefinitelyInitializedPlaces<'a, 'tcx> {
204204

205205
/// `EverInitializedPlaces` tracks all places that might have ever been
206206
/// initialized upon reaching a particular point in the control flow
207-
/// for a function, without an intervening `Storage Dead`.
207+
/// for a function, without an intervening `StorageDead`.
208208
///
209209
/// This dataflow is used to determine if an immutable local variable may
210210
/// be assigned to.

compiler/rustc_mir/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Rust MIR: a lowered representation of Rust.
66

77
#![feature(nll)]
88
#![feature(in_band_lifetimes)]
9+
#![feature(bindings_after_at)]
910
#![feature(bool_to_option)]
1011
#![feature(box_patterns)]
1112
#![feature(box_syntax)]

compiler/rustc_mir/src/transform/dest_prop.rs

+1,057
Large diffs are not rendered by default.

compiler/rustc_mir/src/transform/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ pub mod cleanup_post_borrowck;
2424
pub mod const_prop;
2525
pub mod copy_prop;
2626
pub mod deaggregator;
27+
pub mod dest_prop;
2728
pub mod dump_mir;
2829
pub mod elaborate_drops;
2930
pub mod generator;
@@ -467,6 +468,7 @@ fn run_optimization_passes<'tcx>(
467468
&simplify_comparison_integral::SimplifyComparisonIntegral,
468469
&simplify_try::SimplifyArmIdentity,
469470
&simplify_try::SimplifyBranchSame,
471+
&dest_prop::DestinationPropagation,
470472
&copy_prop::CopyPropagation,
471473
&simplify_branches::SimplifyBranches::new("after-copy-prop"),
472474
&remove_noop_landing_pads::RemoveNoopLandingPads,

compiler/rustc_mir/src/transform/nrvo.rs

+6
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ impl<'tcx> MirPass<'tcx> for RenameReturnPlace {
3636
return;
3737
}
3838

39+
if tcx.sess.opts.debugging_opts.mir_opt_level >= 2 {
40+
// The `DestinationPropagation` pass runs at level 2, so this pass is redundant (and
41+
// fails some asserts).
42+
return;
43+
}
44+
3945
let returned_local = match local_eligible_for_nrvo(body) {
4046
Some(l) => l,
4147
None => {

src/test/mir-opt/const_allocation.main.ConstProp.after.32bit.mir

+14-14
Original file line numberDiff line numberDiff line change
@@ -24,42 +24,42 @@ fn main() -> () {
2424
}
2525

2626
alloc0 (static: FOO, size: 8, align: 4) {
27-
╾─alloc17─╼ 03 00 00 00 │ ╾──╼....
27+
╾─alloc14─╼ 03 00 00 00 │ ╾──╼....
2828
}
2929

30-
alloc17 (size: 48, align: 4) {
30+
alloc14 (size: 48, align: 4) {
3131
0x00 │ 00 00 00 00 __ __ __ __ ╾─alloc4──╼ 00 00 00 00 │ ....░░░░╾──╼....
32-
0x10 │ 00 00 00 00 __ __ __ __ ╾─alloc8──╼ 02 00 00 00 │ ....░░░░╾──╼....
33-
0x20 │ 01 00 00 00 2a 00 00 00 ╾─alloc13─╼ 03 00 00 00 │ ....*...╾──╼....
32+
0x10 │ 00 00 00 00 __ __ __ __ ╾─alloc7──╼ 02 00 00 00 │ ....░░░░╾──╼....
33+
0x20 │ 01 00 00 00 2a 00 00 00 ╾─alloc11─╼ 03 00 00 00 │ ....*...╾──╼....
3434
}
3535

3636
alloc4 (size: 0, align: 4) {}
3737

38-
alloc8 (size: 16, align: 4) {
39-
╾─alloc7──╼ 03 00 00 00 ╾─alloc9──╼ 03 00 00 00 │ ╾──╼....╾──╼....
38+
alloc7 (size: 16, align: 4) {
39+
╾─alloc6──╼ 03 00 00 00 ╾─alloc8──╼ 03 00 00 00 │ ╾──╼....╾──╼....
4040
}
4141

42-
alloc7 (size: 3, align: 1) {
42+
alloc6 (size: 3, align: 1) {
4343
66 6f 6f │ foo
4444
}
4545

46-
alloc9 (size: 3, align: 1) {
46+
alloc8 (size: 3, align: 1) {
4747
62 61 72 │ bar
4848
}
4949

50-
alloc13 (size: 24, align: 4) {
51-
0x00 │ ╾─alloc12─╼ 03 00 00 00 ╾─alloc14─╼ 03 00 00 00 │ ╾──╼....╾──╼....
52-
0x10 │ ╾─alloc15─╼ 04 00 00 00 │ ╾──╼....
50+
alloc11 (size: 24, align: 4) {
51+
0x00 │ ╾─alloc10─╼ 03 00 00 00 ╾─alloc12─╼ 03 00 00 00 │ ╾──╼....╾──╼....
52+
0x10 │ ╾─alloc13─╼ 04 00 00 00 │ ╾──╼....
5353
}
5454

55-
alloc12 (size: 3, align: 1) {
55+
alloc10 (size: 3, align: 1) {
5656
6d 65 68 │ meh
5757
}
5858

59-
alloc14 (size: 3, align: 1) {
59+
alloc12 (size: 3, align: 1) {
6060
6d 6f 70 │ mop
6161
}
6262

63-
alloc15 (size: 4, align: 1) {
63+
alloc13 (size: 4, align: 1) {
6464
6d c3 b6 70 │ m..p
6565
}

src/test/mir-opt/const_allocation.main.ConstProp.after.64bit.mir

+16-16
Original file line numberDiff line numberDiff line change
@@ -24,46 +24,46 @@ fn main() -> () {
2424
}
2525

2626
alloc0 (static: FOO, size: 16, align: 8) {
27-
╾───────alloc17───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
27+
╾───────alloc14───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
2828
}
2929

30-
alloc17 (size: 72, align: 8) {
30+
alloc14 (size: 72, align: 8) {
3131
0x00 │ 00 00 00 00 __ __ __ __ ╾───────alloc4────────╼ │ ....░░░░╾──────╼
3232
0x10 │ 00 00 00 00 00 00 00 00 00 00 00 00 __ __ __ __ │ ............░░░░
33-
0x20 │ ╾───────alloc8────────╼ 02 00 00 00 00 00 00 00 │ ╾──────╼........
34-
0x30 │ 01 00 00 00 2a 00 00 00 ╾───────alloc13───────╼ │ ....*...╾──────╼
33+
0x20 │ ╾───────alloc7────────╼ 02 00 00 00 00 00 00 00 │ ╾──────╼........
34+
0x30 │ 01 00 00 00 2a 00 00 00 ╾───────alloc11───────╼ │ ....*...╾──────╼
3535
0x40 │ 03 00 00 00 00 00 00 00 │ ........
3636
}
3737

3838
alloc4 (size: 0, align: 8) {}
3939

40-
alloc8 (size: 32, align: 8) {
41-
0x00 │ ╾───────alloc7────────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
42-
0x10 │ ╾───────alloc9────────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
40+
alloc7 (size: 32, align: 8) {
41+
0x00 │ ╾───────alloc6────────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
42+
0x10 │ ╾───────alloc8────────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
4343
}
4444

45-
alloc7 (size: 3, align: 1) {
45+
alloc6 (size: 3, align: 1) {
4646
66 6f 6f │ foo
4747
}
4848

49-
alloc9 (size: 3, align: 1) {
49+
alloc8 (size: 3, align: 1) {
5050
62 61 72 │ bar
5151
}
5252

53-
alloc13 (size: 48, align: 8) {
54-
0x00 │ ╾───────alloc12───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
55-
0x10 │ ╾───────alloc14───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
56-
0x20 │ ╾───────alloc15───────╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
53+
alloc11 (size: 48, align: 8) {
54+
0x00 │ ╾───────alloc10───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
55+
0x10 │ ╾───────alloc12───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
56+
0x20 │ ╾───────alloc13───────╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
5757
}
5858

59-
alloc12 (size: 3, align: 1) {
59+
alloc10 (size: 3, align: 1) {
6060
6d 65 68 │ meh
6161
}
6262

63-
alloc14 (size: 3, align: 1) {
63+
alloc12 (size: 3, align: 1) {
6464
6d 6f 70 │ mop
6565
}
6666

67-
alloc15 (size: 4, align: 1) {
67+
alloc13 (size: 4, align: 1) {
6868
6d c3 b6 70 │ m..p
6969
}

src/test/mir-opt/const_allocation2.main.ConstProp.after.32bit.mir

+13-13
Original file line numberDiff line numberDiff line change
@@ -24,41 +24,41 @@ fn main() -> () {
2424
}
2525

2626
alloc0 (static: FOO, size: 8, align: 4) {
27-
╾─alloc23─╼ 03 00 00 00 │ ╾──╼....
27+
╾─alloc20─╼ 03 00 00 00 │ ╾──╼....
2828
}
2929

30-
alloc23 (size: 48, align: 4) {
30+
alloc20 (size: 48, align: 4) {
3131
0x00 │ 00 00 00 00 __ __ __ __ ╾─alloc8──╼ 00 00 00 00 │ ....░░░░╾──╼....
32-
0x10 │ 00 00 00 00 __ __ __ __ ╾─alloc13─╼ 02 00 00 00 │ ....░░░░╾──╼....
33-
0x20 │ 01 00 00 00 2a 00 00 00 ╾─alloc21─╼ 03 00 00 00 │ ....*...╾──╼....
32+
0x10 │ 00 00 00 00 __ __ __ __ ╾─alloc12─╼ 02 00 00 00 │ ....░░░░╾──╼....
33+
0x20 │ 01 00 00 00 2a 00 00 00 ╾─alloc19─╼ 03 00 00 00 │ ....*...╾──╼....
3434
}
3535

3636
alloc8 (size: 0, align: 4) {}
3737

38-
alloc13 (size: 8, align: 4) {
39-
╾─alloc11─╼ ╾─alloc12─╼ │ ╾──╼╾──╼
38+
alloc12 (size: 8, align: 4) {
39+
╾─alloc10─╼ ╾─alloc11─╼ │ ╾──╼╾──╼
4040
}
4141

42-
alloc11 (size: 1, align: 1) {
42+
alloc10 (size: 1, align: 1) {
4343
05 │ .
4444
}
4545

46-
alloc12 (size: 1, align: 1) {
46+
alloc11 (size: 1, align: 1) {
4747
06 │ .
4848
}
4949

50-
alloc21 (size: 12, align: 4) {
51-
╾─a17+0x3─╼ ╾─alloc18─╼ ╾─a20+0x2─╼ │ ╾──╼╾──╼╾──╼
50+
alloc19 (size: 12, align: 4) {
51+
╾─a15+0x3─╼ ╾─alloc16─╼ ╾─a18+0x2─╼ │ ╾──╼╾──╼╾──╼
5252
}
5353

54-
alloc17 (size: 4, align: 1) {
54+
alloc15 (size: 4, align: 1) {
5555
2a 45 15 6f │ *E.o
5656
}
5757

58-
alloc18 (size: 1, align: 1) {
58+
alloc16 (size: 1, align: 1) {
5959
2a │ *
6060
}
6161

62-
alloc20 (size: 4, align: 1) {
62+
alloc18 (size: 4, align: 1) {
6363
2a 45 15 6f │ *E.o
6464
}

src/test/mir-opt/const_allocation2.main.ConstProp.after.64bit.mir

+14-14
Original file line numberDiff line numberDiff line change
@@ -24,44 +24,44 @@ fn main() -> () {
2424
}
2525

2626
alloc0 (static: FOO, size: 16, align: 8) {
27-
╾───────alloc23───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
27+
╾───────alloc20───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
2828
}
2929

30-
alloc23 (size: 72, align: 8) {
30+
alloc20 (size: 72, align: 8) {
3131
0x00 │ 00 00 00 00 __ __ __ __ ╾───────alloc8────────╼ │ ....░░░░╾──────╼
3232
0x10 │ 00 00 00 00 00 00 00 00 00 00 00 00 __ __ __ __ │ ............░░░░
33-
0x20 │ ╾───────alloc13───────╼ 02 00 00 00 00 00 00 00 │ ╾──────╼........
34-
0x30 │ 01 00 00 00 2a 00 00 00 ╾───────alloc21───────╼ │ ....*...╾──────╼
33+
0x20 │ ╾───────alloc12───────╼ 02 00 00 00 00 00 00 00 │ ╾──────╼........
34+
0x30 │ 01 00 00 00 2a 00 00 00 ╾───────alloc19───────╼ │ ....*...╾──────╼
3535
0x40 │ 03 00 00 00 00 00 00 00 │ ........
3636
}
3737

3838
alloc8 (size: 0, align: 8) {}
3939

40-
alloc13 (size: 16, align: 8) {
41-
╾───────alloc11───────╼ ╾───────alloc12───────╼ │ ╾──────╼╾──────╼
40+
alloc12 (size: 16, align: 8) {
41+
╾───────alloc10───────╼ ╾───────alloc11───────╼ │ ╾──────╼╾──────╼
4242
}
4343

44-
alloc11 (size: 1, align: 1) {
44+
alloc10 (size: 1, align: 1) {
4545
05 │ .
4646
}
4747

48-
alloc12 (size: 1, align: 1) {
48+
alloc11 (size: 1, align: 1) {
4949
06 │ .
5050
}
5151

52-
alloc21 (size: 24, align: 8) {
53-
0x00 │ ╾─────alloc17+0x3─────╼ ╾───────alloc18───────╼ │ ╾──────╼╾──────╼
54-
0x10 │ ╾─────alloc20+0x2─────╼ │ ╾──────╼
52+
alloc19 (size: 24, align: 8) {
53+
0x00 │ ╾─────alloc15+0x3─────╼ ╾───────alloc16───────╼ │ ╾──────╼╾──────╼
54+
0x10 │ ╾─────alloc18+0x2─────╼ │ ╾──────╼
5555
}
5656

57-
alloc17 (size: 4, align: 1) {
57+
alloc15 (size: 4, align: 1) {
5858
2a 45 15 6f │ *E.o
5959
}
6060

61-
alloc18 (size: 1, align: 1) {
61+
alloc16 (size: 1, align: 1) {
6262
2a │ *
6363
}
6464

65-
alloc20 (size: 4, align: 1) {
65+
alloc18 (size: 4, align: 1) {
6666
2a 45 15 6f │ *E.o
6767
}

src/test/mir-opt/const_allocation3.main.ConstProp.after.32bit.mir

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ fn main() -> () {
2424
}
2525

2626
alloc0 (static: FOO, size: 4, align: 4) {
27-
╾─alloc9──╼ │ ╾──╼
27+
╾─alloc3──╼ │ ╾──╼
2828
}
2929

30-
alloc9 (size: 168, align: 1) {
30+
alloc3 (size: 168, align: 1) {
3131
0x00 │ ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab │ ................
3232
0x10 │ ab ab ab ab ab ab ab ab ab ab ab ab ╾─alloc4──╼ │ ............╾──╼
3333
0x20 │ 01 ef cd ab 00 00 00 00 00 00 00 00 00 00 00 00 │ ................

src/test/mir-opt/const_allocation3.main.ConstProp.after.64bit.mir

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ fn main() -> () {
2424
}
2525

2626
alloc0 (static: FOO, size: 8, align: 8) {
27-
╾───────alloc9────────╼ │ ╾──────╼
27+
╾───────alloc3────────╼ │ ╾──────╼
2828
}
2929

30-
alloc9 (size: 180, align: 1) {
30+
alloc3 (size: 180, align: 1) {
3131
0x00 │ ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab │ ................
3232
0x10 │ ab ab ab ab ab ab ab ab ab ab ab ab ╾──alloc4── │ ............╾───
3333
0x20 │ ──────────╼ 01 ef cd ab 00 00 00 00 00 00 00 00 │ ───╼............

src/test/mir-opt/copy_propagation.test.CopyPropagation.diff

+5-10
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,14 @@
66
let mut _0: u32; // return place in scope 0 at $DIR/copy_propagation.rs:3:20: 3:23
77
let _2: u32; // in scope 0 at $DIR/copy_propagation.rs:4:9: 4:10
88
scope 1 {
9-
- debug y => _2; // in scope 1 at $DIR/copy_propagation.rs:4:9: 4:10
10-
+ debug y => _1; // in scope 1 at $DIR/copy_propagation.rs:4:9: 4:10
9+
debug y => _0; // in scope 1 at $DIR/copy_propagation.rs:4:9: 4:10
1110
}
1211

1312
bb0: {
14-
- StorageLive(_2); // scope 0 at $DIR/copy_propagation.rs:4:9: 4:10
15-
- _2 = _1; // scope 0 at $DIR/copy_propagation.rs:4:13: 4:14
16-
- _0 = _2; // scope 1 at $DIR/copy_propagation.rs:5:5: 5:6
17-
- StorageDead(_2); // scope 0 at $DIR/copy_propagation.rs:6:1: 6:2
18-
+ nop; // scope 0 at $DIR/copy_propagation.rs:4:9: 4:10
19-
+ nop; // scope 0 at $DIR/copy_propagation.rs:4:13: 4:14
20-
+ _0 = _1; // scope 1 at $DIR/copy_propagation.rs:5:5: 5:6
21-
+ nop; // scope 0 at $DIR/copy_propagation.rs:6:1: 6:2
13+
nop; // scope 0 at $DIR/copy_propagation.rs:4:9: 4:10
14+
_0 = _1; // scope 0 at $DIR/copy_propagation.rs:4:13: 4:14
15+
nop; // scope 1 at $DIR/copy_propagation.rs:5:5: 5:6
16+
nop; // scope 0 at $DIR/copy_propagation.rs:6:1: 6:2
2217
return; // scope 0 at $DIR/copy_propagation.rs:6:2: 6:2
2318
}
2419
}

src/test/mir-opt/copy_propagation_arg.arg_src.CopyPropagation.diff

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
let mut _0: i32; // return place in scope 0 at $DIR/copy_propagation_arg.rs:27:27: 27:30
77
let _2: i32; // in scope 0 at $DIR/copy_propagation_arg.rs:28:9: 28:10
88
scope 1 {
9-
debug y => _2; // in scope 1 at $DIR/copy_propagation_arg.rs:28:9: 28:10
9+
debug y => _0; // in scope 1 at $DIR/copy_propagation_arg.rs:28:9: 28:10
1010
}
1111

1212
bb0: {
13-
StorageLive(_2); // scope 0 at $DIR/copy_propagation_arg.rs:28:9: 28:10
14-
_2 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:28:13: 28:14
13+
nop; // scope 0 at $DIR/copy_propagation_arg.rs:28:9: 28:10
14+
_0 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:28:13: 28:14
1515
_1 = const 123_i32; // scope 1 at $DIR/copy_propagation_arg.rs:29:5: 29:12
16-
_0 = _2; // scope 1 at $DIR/copy_propagation_arg.rs:30:5: 30:6
17-
StorageDead(_2); // scope 0 at $DIR/copy_propagation_arg.rs:31:1: 31:2
16+
nop; // scope 1 at $DIR/copy_propagation_arg.rs:30:5: 30:6
17+
nop; // scope 0 at $DIR/copy_propagation_arg.rs:31:1: 31:2
1818
return; // scope 0 at $DIR/copy_propagation_arg.rs:31:2: 31:2
1919
}
2020
}

src/test/mir-opt/copy_propagation_arg.baz.CopyPropagation.diff

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
let mut _2: i32; // in scope 0 at $DIR/copy_propagation_arg.rs:23:9: 23:10
88

99
bb0: {
10-
StorageLive(_2); // scope 0 at $DIR/copy_propagation_arg.rs:23:9: 23:10
11-
_2 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:23:9: 23:10
12-
_1 = move _2; // scope 0 at $DIR/copy_propagation_arg.rs:23:5: 23:10
13-
StorageDead(_2); // scope 0 at $DIR/copy_propagation_arg.rs:23:9: 23:10
10+
nop; // scope 0 at $DIR/copy_propagation_arg.rs:23:9: 23:10
11+
nop; // scope 0 at $DIR/copy_propagation_arg.rs:23:9: 23:10
12+
nop; // scope 0 at $DIR/copy_propagation_arg.rs:23:5: 23:10
13+
nop; // scope 0 at $DIR/copy_propagation_arg.rs:23:9: 23:10
1414
_0 = const (); // scope 0 at $DIR/copy_propagation_arg.rs:21:20: 24:2
1515
return; // scope 0 at $DIR/copy_propagation_arg.rs:24:2: 24:2
1616
}

src/test/mir-opt/copy_propagation_arg.foo.CopyPropagation.diff

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@
88
let mut _3: u8; // in scope 0 at $DIR/copy_propagation_arg.rs:11:15: 11:16
99

1010
bb0: {
11-
StorageLive(_2); // scope 0 at $DIR/copy_propagation_arg.rs:11:9: 11:17
11+
nop; // scope 0 at $DIR/copy_propagation_arg.rs:11:9: 11:17
1212
StorageLive(_3); // scope 0 at $DIR/copy_propagation_arg.rs:11:15: 11:16
1313
_3 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:11:15: 11:16
14-
_2 = dummy(move _3) -> bb1; // scope 0 at $DIR/copy_propagation_arg.rs:11:9: 11:17
14+
_1 = dummy(move _3) -> bb1; // scope 0 at $DIR/copy_propagation_arg.rs:11:9: 11:17
1515
// mir::Constant
1616
// + span: $DIR/copy_propagation_arg.rs:11:9: 11:14
1717
// + literal: Const { ty: fn(u8) -> u8 {dummy}, val: Value(Scalar(<ZST>)) }
1818
}
1919

2020
bb1: {
2121
StorageDead(_3); // scope 0 at $DIR/copy_propagation_arg.rs:11:16: 11:17
22-
_1 = move _2; // scope 0 at $DIR/copy_propagation_arg.rs:11:5: 11:17
23-
StorageDead(_2); // scope 0 at $DIR/copy_propagation_arg.rs:11:16: 11:17
22+
nop; // scope 0 at $DIR/copy_propagation_arg.rs:11:5: 11:17
23+
nop; // scope 0 at $DIR/copy_propagation_arg.rs:11:16: 11:17
2424
_0 = const (); // scope 0 at $DIR/copy_propagation_arg.rs:9:19: 12:2
2525
return; // scope 0 at $DIR/copy_propagation_arg.rs:12:2: 12:2
2626
}

0 commit comments

Comments
 (0)