diff options
| author | dianqk <dianqk@dianqk.net> | 2025-06-08 15:30:09 +0800 |
|---|---|---|
| committer | dianqk <dianqk@dianqk.net> | 2025-10-02 14:55:50 +0800 |
| commit | 571412f8190089c36758031fe09fc0ece59be6b7 (patch) | |
| tree | 3c1370be293a5aa1e4d8419ce9807b3f4b3b6ba1 /tests/mir-opt/dead-store-elimination/ref.tuple.DeadStoreElimination-initial.diff | |
| parent | 42b384ec0dfcd528d99a4db0a337d9188a9eecaa (diff) | |
| download | rust-571412f8190089c36758031fe09fc0ece59be6b7.tar.gz rust-571412f8190089c36758031fe09fc0ece59be6b7.zip | |
mir-opt: Eliminate dead ref statements
Diffstat (limited to 'tests/mir-opt/dead-store-elimination/ref.tuple.DeadStoreElimination-initial.diff')
| -rw-r--r-- | tests/mir-opt/dead-store-elimination/ref.tuple.DeadStoreElimination-initial.diff | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/mir-opt/dead-store-elimination/ref.tuple.DeadStoreElimination-initial.diff b/tests/mir-opt/dead-store-elimination/ref.tuple.DeadStoreElimination-initial.diff new file mode 100644 index 00000000000..0547a42cab2 --- /dev/null +++ b/tests/mir-opt/dead-store-elimination/ref.tuple.DeadStoreElimination-initial.diff @@ -0,0 +1,26 @@ +- // MIR for `tuple` before DeadStoreElimination-initial ++ // MIR for `tuple` after DeadStoreElimination-initial + + fn tuple(_1: (i32, &Foo)) -> i32 { + debug v => _1; + let mut _0: i32; + let _2: &i32; + let mut _3: &Foo; + let mut _4: &Foo; + scope 1 { + debug _dead => _2; + } + + bb0: { + StorageLive(_2); + _3 = deref_copy (_1.1: &Foo); +- _2 = &((*_3).2: i32); ++ // DBG: _2 = &((*_3).2: i32); ++ nop; + _4 = deref_copy (_1.1: &Foo); + _0 = copy ((*_4).0: i32); + StorageDead(_2); + return; + } + } + |
