about summary refs log tree commit diff
path: root/tests/mir-opt/reference_prop.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-08-19 23:10:46 +0000
committerbors <bors@rust-lang.org>2024-08-19 23:10:46 +0000
commit79611d90b6b3fc6f17a0b07ba228b28e89de16e3 (patch)
treec84e12cab4b353c1471ccde4880fc47656c0f7bc /tests/mir-opt/reference_prop.rs
parent636d7ff91b9847d6d43c7bbe023568828f6e3246 (diff)
parentb9cffa7de071e8deae2b0c6b4780bba25f8ec875 (diff)
downloadrust-79611d90b6b3fc6f17a0b07ba228b28e89de16e3.tar.gz
rust-79611d90b6b3fc6f17a0b07ba228b28e89de16e3.zip
Auto merge of #122551 - RayMuir:copy_fmt, r=saethlin
Added "copy" to Debug fmt for copy operands

In MIR's debug mode (--emit mir) the printing for Operands is slightly inconsistent.

The RValues - values on the right side of an Assign - are usually printed with their Operand when they are Places.

Example:
_2 = move _3

But for arguments, the operand is omitted.

_2 = _1

I propose a change be made, to display the place with the operand.

_2 = copy _1

Move and copy have different semantics, meaning this difference is important and helpful to the user. It also adds consistency to the pretty printing.

-- EDIT --

 Consider this example Rust program and its MIR output with the **updated pretty printer.**

This was generated with the arguments --emit mir --crate-type lib -Zmir-opt-level=0 (Otherwise, it's optimised away since it's a junk program).

```rust
fn main(foo: i32) {
    let v = 10;

    if v == 20 {
        foo;
    }
    else {
        v;
    }
}
```

```MIR
// WARNING: This output format is intended for human consumers only
// and is subject to change without notice. Knock yourself out.
fn main(_1: i32) -> () {
    debug foo => _1;
    let mut _0: ();
    let _2: i32;
    let mut _3: bool;
    let mut _4: i32;
    let _5: i32;
    let _6: i32;
    scope 1 {
        debug v => _2;
    }

    bb0: {
        StorageLive(_2);
        _2 = const 10_i32;
        StorageLive(_3);
        StorageLive(_4);
        _4 = copy _2;
        _3 = Eq(move _4, const 20_i32);
        switchInt(move _3) -> [0: bb2, otherwise: bb1];
    }

    bb1: {
        StorageDead(_4);
        StorageLive(_5);
        _5 = copy _1;
        StorageDead(_5);
        _0 = const ();
        goto -> bb3;
    }

    bb2: {
        StorageDead(_4);
        StorageLive(_6);
        _6 = copy _2;
        StorageDead(_6);
        _0 = const ();
        goto -> bb3;
    }

    bb3: {
        StorageDead(_3);
        StorageDead(_2);
        return;
    }
}
```

In this example program, we can see that when we move a place, it is preceded by "move". e.g. ``` _3 = Eq(move _4, const 20_i32);```. However, when we copy a place such as ```_5 = _1;```, it is not preceded by the operand in the original printout. I propose to change the print to include the copy ```_5 = copy _1``` as in this example.

Regarding the arguments part. When I originally submitted this PR, I was under the impression this only affected the print for arguments to a function, but actually, it affects anything that uses a copy. This is preferable anyway with regard to consistency. The PR is about making ```copy``` explicit.
Diffstat (limited to 'tests/mir-opt/reference_prop.rs')
-rw-r--r--tests/mir-opt/reference_prop.rs114
1 files changed, 57 insertions, 57 deletions
diff --git a/tests/mir-opt/reference_prop.rs b/tests/mir-opt/reference_prop.rs
index 7c5c02ee7ef..00d48938071 100644
--- a/tests/mir-opt/reference_prop.rs
+++ b/tests/mir-opt/reference_prop.rs
@@ -15,7 +15,7 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) {
         // CHECK: bb0: {
         // CHECK: [[a:_.*]] = const 5_usize;
         // CHECK: [[b:_.*]] = &[[a]];
-        // CHECK: [[c:_.*]] = [[a]];
+        // CHECK: [[c:_.*]] = copy [[a]];
 
         let a = 5_usize;
         let b = &a; // This borrow is only used once.
@@ -31,7 +31,7 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) {
         // CHECK: [[b:_.*]] = &[[a]];
         // CHECK: [[btmp:_.*]] = &[[a2]];
         // CHECK: [[b]] = move [[btmp]];
-        // CHECK: [[c:_.*]] = (*[[b]]);
+        // CHECK: [[c:_.*]] = copy (*[[b]]);
 
         let a = 5_usize;
         let a2 = 7_usize;
@@ -48,7 +48,7 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) {
         // CHECK: [[a:_.*]] = const 5_usize;
         // CHECK: [[b:_.*]] = &[[a]];
         // CHECK: [[d:_.*]] = &[[b]];
-        // CHECK: [[c:_.*]] = [[a]];
+        // CHECK: [[c:_.*]] = copy [[a]];
 
         let a = 5_usize;
         let b = &a;
@@ -63,7 +63,7 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) {
         // CHECK: [[a:_.*]] = const 5_usize;
         // CHECK: [[b:_.*]] = &[[a]];
         // CHECK: [[d:_.*]] = &raw mut [[b]];
-        // CHECK: [[c:_.*]] = (*[[b]]);
+        // CHECK: [[c:_.*]] = copy (*[[b]]);
 
         let a = 5_usize;
         let mut b = &a;
@@ -77,7 +77,7 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) {
         // CHECK: bb4: {
         // CHECK: [[a:_.*]] = const 7_usize;
         // CHECK: [[b:_.*]] = &[[a]];
-        // CHECK: [[c:_.*]] = [[a]];
+        // CHECK: [[c:_.*]] = copy [[a]];
 
         let a = 7_usize;
         let b = &a;
@@ -90,10 +90,10 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) {
         // CHECK: bb5: {
         // CHECK: [[a:_.*]] = const 7_usize;
         // CHECK: [[b1:_.*]] = &[[a]];
-        // CHECK: [[c:_.*]] = [[a]];
-        // CHECK: [[b2:_.*]] = [[b1]];
-        // CHECK: [[c2:_.*]] = [[a]];
-        // CHECK: [[b3:_.*]] = [[b2]];
+        // CHECK: [[c:_.*]] = copy [[a]];
+        // CHECK: [[b2:_.*]] = copy [[b1]];
+        // CHECK: [[c2:_.*]] = copy [[a]];
+        // CHECK: [[b3:_.*]] = copy [[b2]];
 
         let a = 7_usize;
         let b1 = &a;
@@ -110,7 +110,7 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) {
     {
         // CHECK: bb6: {
         // CHECK-NOT: {{_.*}} = &(*_1);
-        // CHECK: [[b:_.*]] = (*_1);
+        // CHECK: [[b:_.*]] = copy (*_1);
 
         let a = &*single;
         let b = *a; // This should be optimized as `*single`.
@@ -123,7 +123,7 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) {
         // CHECK: [[a:_.*]] = &(*_2);
         // CHECK: [[tmp:_.*]] = &(*_1);
         // CHECK: _2 = move [[tmp]];
-        // CHECK: [[b:_.*]] = (*[[a]]);
+        // CHECK: [[b:_.*]] = copy (*[[a]]);
 
         let a = &*multiple;
         multiple = &*single;
@@ -137,7 +137,7 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) {
         // CHECK: [[a:_.*]] = const 5_usize;
         // CHECK: [[b:_.*]] = &[[a]];
         // CHECK: [[d:_.*]] = &[[b]];
-        // CHECK: [[c:_.*]] = [[a]];
+        // CHECK: [[c:_.*]] = copy [[a]];
 
         let a = 5_usize;
         let b = &a;
@@ -153,7 +153,7 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) {
         // CHECK: [[b:_.*]] = &[[a]];
         // CHECK: [[d:_.*]] = &mut [[b]];
         // FIXME this could be [[a]]
-        // CHECK: [[c:_.*]] = (*[[b]]);
+        // CHECK: [[c:_.*]] = copy (*[[b]]);
 
         let a = 5_usize;
         let mut b = &a;
@@ -171,7 +171,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m
         // CHECK: bb0: {
         // CHECK: [[a:_.*]] = const 5_usize;
         // CHECK: [[b:_.*]] = &mut [[a]];
-        // CHECK: [[c:_.*]] = [[a]];
+        // CHECK: [[c:_.*]] = copy [[a]];
 
         let mut a = 5_usize;
         let b = &mut a; // This borrow is only used once.
@@ -187,7 +187,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m
         // CHECK: [[b:_.*]] = &mut [[a]];
         // CHECK: [[btmp:_.*]] = &mut [[a2]];
         // CHECK: [[b]] = move [[btmp]];
-        // CHECK: [[c:_.*]] = (*[[b]]);
+        // CHECK: [[c:_.*]] = copy (*[[b]]);
 
         let mut a = 5_usize;
         let mut a2 = 7_usize;
@@ -204,7 +204,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m
         // CHECK: [[a:_.*]] = const 5_usize;
         // CHECK: [[b:_.*]] = &mut [[a]];
         // CHECK: [[d:_.*]] = &[[b]];
-        // CHECK: [[c:_.*]] = (*[[b]]);
+        // CHECK: [[c:_.*]] = copy (*[[b]]);
 
         let mut a = 5_usize;
         let b = &mut a;
@@ -219,7 +219,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m
         // CHECK: [[a:_.*]] = const 5_usize;
         // CHECK: [[b:_.*]] = &mut [[a]];
         // CHECK: [[d:_.*]] = &raw mut [[b]];
-        // CHECK: [[c:_.*]] = (*[[b]]);
+        // CHECK: [[c:_.*]] = copy (*[[b]]);
 
         let mut a = 5_usize;
         let mut b = &mut a;
@@ -233,7 +233,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m
         // CHECK: bb4: {
         // CHECK: [[a:_.*]] = const 7_usize;
         // CHECK: [[b:_.*]] = &mut [[a]];
-        // CHECK: [[c:_.*]] = (*[[b]]);
+        // CHECK: [[c:_.*]] = copy (*[[b]]);
 
         let mut a = 7_usize;
         let b = &mut a;
@@ -246,9 +246,9 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m
         // CHECK: bb5: {
         // CHECK: [[a:_.*]] = const 7_usize;
         // CHECK: [[b1:_.*]] = &mut [[a]];
-        // CHECK: [[c:_.*]] = (*[[b1]]);
+        // CHECK: [[c:_.*]] = copy (*[[b1]]);
         // CHECK: [[b2:_.*]] = move [[b1]];
-        // CHECK: [[c2:_.*]] = (*[[b2]]);
+        // CHECK: [[c2:_.*]] = copy (*[[b2]]);
         // CHECK: [[b3:_.*]] = move [[b2]];
 
         let mut a = 7_usize;
@@ -266,7 +266,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m
     {
         // CHECK: bb6: {
         // CHECK-NOT: {{_.*}} = &(*_1);
-        // CHECK: [[b:_.*]] = (*_1);
+        // CHECK: [[b:_.*]] = copy (*_1);
 
         let a = &mut *single;
         let b = *a; // This should be optimized as `*single`.
@@ -279,7 +279,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m
         // CHECK: [[a:_.*]] = &mut (*_2);
         // CHECK: [[tmp:_.*]] = &mut (*_1);
         // CHECK: _2 = move [[tmp]];
-        // CHECK: [[b:_.*]] = (*[[a]]);
+        // CHECK: [[b:_.*]] = copy (*[[a]]);
 
         let a = &mut *multiple;
         multiple = &mut *single;
@@ -294,7 +294,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m
         // CHECK: [[b:_.*]] = &mut [[a]];
         // CHECK: [[d:_.*]] = &[[b]];
         // FIXME this could be [[a]]
-        // CHECK: [[c:_.*]] = (*[[b]]);
+        // CHECK: [[c:_.*]] = copy (*[[b]]);
 
         let mut a = 5_usize;
         let b = &mut a;
@@ -310,7 +310,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m
         // CHECK: [[b:_.*]] = &mut [[a]];
         // CHECK: [[d:_.*]] = &mut [[b]];
         // FIXME this could be [[a]]
-        // CHECK: [[c:_.*]] = (*[[b]]);
+        // CHECK: [[c:_.*]] = copy (*[[b]]);
 
         let mut a = 5_usize;
         let mut b = &mut a;
@@ -328,7 +328,7 @@ fn reference_propagation_const_ptr<T: Copy>(single: *const T, mut multiple: *con
         // CHECK: bb0: {
         // CHECK: [[a:_.*]] = const 5_usize;
         // CHECK: [[b:_.*]] = &raw const [[a]];
-        // CHECK: [[c:_.*]] = [[a]];
+        // CHECK: [[c:_.*]] = copy [[a]];
 
         let a = 5_usize;
         let b = &raw const a; // This borrow is only used once.
@@ -344,7 +344,7 @@ fn reference_propagation_const_ptr<T: Copy>(single: *const T, mut multiple: *con
         // CHECK: [[b:_.*]] = &raw const [[a]];
         // CHECK: [[btmp:_.*]] = &raw const [[a2]];
         // CHECK: [[b]] = move [[btmp]];
-        // CHECK: [[c:_.*]] = (*[[b]]);
+        // CHECK: [[c:_.*]] = copy (*[[b]]);
 
         let a = 5_usize;
         let a2 = 7_usize;
@@ -361,7 +361,7 @@ fn reference_propagation_const_ptr<T: Copy>(single: *const T, mut multiple: *con
         // CHECK: [[a:_.*]] = const 5_usize;
         // CHECK: [[b:_.*]] = &raw const [[a]];
         // CHECK: [[d:_.*]] = &[[b]];
-        // CHECK: [[c:_.*]] = [[a]];
+        // CHECK: [[c:_.*]] = copy [[a]];
 
         let a = 5_usize;
         let b = &raw const a;
@@ -376,7 +376,7 @@ fn reference_propagation_const_ptr<T: Copy>(single: *const T, mut multiple: *con
         // CHECK: [[a:_.*]] = const 5_usize;
         // CHECK: [[b:_.*]] = &raw const [[a]];
         // CHECK: [[d:_.*]] = &raw mut [[b]];
-        // CHECK: [[c:_.*]] = (*[[b]]);
+        // CHECK: [[c:_.*]] = copy (*[[b]]);
 
         let a = 5_usize;
         let mut b = &raw const a;
@@ -390,7 +390,7 @@ fn reference_propagation_const_ptr<T: Copy>(single: *const T, mut multiple: *con
         // CHECK: bb4: {
         // CHECK: [[a:_.*]] = const 7_usize;
         // CHECK: [[b:_.*]] = &raw const [[a]];
-        // CHECK: [[c:_.*]] = [[a]];
+        // CHECK: [[c:_.*]] = copy [[a]];
 
         let a = 7_usize;
         let b = &raw const a;
@@ -403,10 +403,10 @@ fn reference_propagation_const_ptr<T: Copy>(single: *const T, mut multiple: *con
         // CHECK: bb5: {
         // CHECK: [[a:_.*]] = const 7_usize;
         // CHECK: [[b1:_.*]] = &raw const [[a]];
-        // CHECK: [[c:_.*]] = [[a]];
-        // CHECK: [[b2:_.*]] = [[b1]];
-        // CHECK: [[c2:_.*]] = [[a]];
-        // CHECK: [[b3:_.*]] = [[b2]];
+        // CHECK: [[c:_.*]] = copy [[a]];
+        // CHECK: [[b2:_.*]] = copy [[b1]];
+        // CHECK: [[c2:_.*]] = copy [[a]];
+        // CHECK: [[b3:_.*]] = copy [[b2]];
 
         let a = 7_usize;
         let b1 = &raw const a;
@@ -423,7 +423,7 @@ fn reference_propagation_const_ptr<T: Copy>(single: *const T, mut multiple: *con
     unsafe {
         // CHECK: bb6: {
         // CHECK-NOT: {{_.*}} = &(*_1);
-        // CHECK: [[b:_.*]] = (*_1);
+        // CHECK: [[b:_.*]] = copy (*_1);
 
         let a = &raw const *single;
         let b = *a; // This should be optimized as `*single`.
@@ -436,7 +436,7 @@ fn reference_propagation_const_ptr<T: Copy>(single: *const T, mut multiple: *con
         // CHECK: [[a:_.*]] = &raw const (*_2);
         // CHECK: [[tmp:_.*]] = &raw const (*_1);
         // CHECK: _2 = move [[tmp]];
-        // CHECK: [[b:_.*]] = (*[[a]]);
+        // CHECK: [[b:_.*]] = copy (*[[a]]);
 
         let a = &raw const *multiple;
         multiple = &raw const *single;
@@ -450,7 +450,7 @@ fn reference_propagation_const_ptr<T: Copy>(single: *const T, mut multiple: *con
         // CHECK: [[a:_.*]] = const 13_usize;
         // CHECK: [[b:_.*]] = &raw const [[a]];
         // CHECK: [[d:_.*]] = &raw const [[a]];
-        // CHECK: [[c:_.*]] = [[a]];
+        // CHECK: [[c:_.*]] = copy [[a]];
 
         let a = 13_usize;
         let b = &raw const a;
@@ -465,7 +465,7 @@ fn reference_propagation_const_ptr<T: Copy>(single: *const T, mut multiple: *con
         // CHECK: [[a:_.*]] = const 5_usize;
         // CHECK: [[b:_.*]] = &raw const [[a]];
         // CHECK: [[d:_.*]] = &[[b]];
-        // CHECK: [[c:_.*]] = [[a]];
+        // CHECK: [[c:_.*]] = copy [[a]];
 
         let a = 5_usize;
         let b = &raw const a;
@@ -481,7 +481,7 @@ fn reference_propagation_const_ptr<T: Copy>(single: *const T, mut multiple: *con
         // CHECK: [[b:_.*]] = &raw const [[a]];
         // CHECK: [[d:_.*]] = &mut [[b]];
         // FIXME this could be [[a]]
-        // CHECK: [[c:_.*]] = (*[[b]]);
+        // CHECK: [[c:_.*]] = copy (*[[b]]);
 
         let a = 5_usize;
         let mut b = &raw const a;
@@ -499,7 +499,7 @@ fn reference_propagation_mut_ptr<T: Copy>(single: *mut T, mut multiple: *mut T)
         // CHECK: bb0: {
         // CHECK: [[a:_.*]] = const 5_usize;
         // CHECK: [[b:_.*]] = &raw mut [[a]];
-        // CHECK: [[c:_.*]] = [[a]];
+        // CHECK: [[c:_.*]] = copy [[a]];
 
         let mut a = 5_usize;
         let b = &raw mut a; // This borrow is only used once.
@@ -515,7 +515,7 @@ fn reference_propagation_mut_ptr<T: Copy>(single: *mut T, mut multiple: *mut T)
         // CHECK: [[b:_.*]] = &raw mut [[a]];
         // CHECK: [[btmp:_.*]] = &raw mut [[a2]];
         // CHECK: [[b]] = move [[btmp]];
-        // CHECK: [[c:_.*]] = (*[[b]]);
+        // CHECK: [[c:_.*]] = copy (*[[b]]);
 
         let mut a = 5_usize;
         let mut a2 = 7_usize;
@@ -532,7 +532,7 @@ fn reference_propagation_mut_ptr<T: Copy>(single: *mut T, mut multiple: *mut T)
         // CHECK: [[a:_.*]] = const 5_usize;
         // CHECK: [[b:_.*]] = &raw mut [[a]];
         // CHECK: [[d:_.*]] = &[[b]];
-        // CHECK: [[c:_.*]] = (*[[b]]);
+        // CHECK: [[c:_.*]] = copy (*[[b]]);
 
         let mut a = 5_usize;
         let b = &raw mut a;
@@ -547,7 +547,7 @@ fn reference_propagation_mut_ptr<T: Copy>(single: *mut T, mut multiple: *mut T)
         // CHECK: [[a:_.*]] = const 5_usize;
         // CHECK: [[b:_.*]] = &raw mut [[a]];
         // CHECK: [[d:_.*]] = &raw mut [[b]];
-        // CHECK: [[c:_.*]] = (*[[b]]);
+        // CHECK: [[c:_.*]] = copy (*[[b]]);
 
         let mut a = 5_usize;
         let mut b = &raw mut a;
@@ -561,7 +561,7 @@ fn reference_propagation_mut_ptr<T: Copy>(single: *mut T, mut multiple: *mut T)
         // CHECK: bb4: {
         // CHECK: [[a:_.*]] = const 7_usize;
         // CHECK: [[b:_.*]] = &raw mut [[a]];
-        // CHECK: [[c:_.*]] = (*[[b]]);
+        // CHECK: [[c:_.*]] = copy (*[[b]]);
 
         let mut a = 7_usize;
         let b = &raw mut a;
@@ -574,10 +574,10 @@ fn reference_propagation_mut_ptr<T: Copy>(single: *mut T, mut multiple: *mut T)
         // CHECK: bb5: {
         // CHECK: [[a:_.*]] = const 7_usize;
         // CHECK: [[b1:_.*]] = &raw mut [[a]];
-        // CHECK: [[c:_.*]] = (*[[b1]]);
-        // CHECK: [[b2:_.*]] = [[b1]];
-        // CHECK: [[c2:_.*]] = (*[[b2]]);
-        // CHECK: [[b3:_.*]] = [[b2]];
+        // CHECK: [[c:_.*]] = copy (*[[b1]]);
+        // CHECK: [[b2:_.*]] = copy [[b1]];
+        // CHECK: [[c2:_.*]] = copy (*[[b2]]);
+        // CHECK: [[b3:_.*]] = copy [[b2]];
 
         let mut a = 7_usize;
         let b1 = &raw mut a;
@@ -594,7 +594,7 @@ fn reference_propagation_mut_ptr<T: Copy>(single: *mut T, mut multiple: *mut T)
     unsafe {
         // CHECK: bb6: {
         // CHECK-NOT: {{_.*}} = &(*_1);
-        // CHECK: [[b:_.*]] = (*_1);
+        // CHECK: [[b:_.*]] = copy (*_1);
 
         let a = &raw mut *single;
         let b = *a; // This should be optimized as `*single`.
@@ -607,7 +607,7 @@ fn reference_propagation_mut_ptr<T: Copy>(single: *mut T, mut multiple: *mut T)
         // CHECK: [[a:_.*]] = &raw mut (*_2);
         // CHECK: [[tmp:_.*]] = &raw mut (*_1);
         // CHECK: _2 = move [[tmp]];
-        // CHECK: [[b:_.*]] = (*[[a]]);
+        // CHECK: [[b:_.*]] = copy (*[[a]]);
 
         let a = &raw mut *multiple;
         multiple = &raw mut *single;
@@ -622,7 +622,7 @@ fn reference_propagation_mut_ptr<T: Copy>(single: *mut T, mut multiple: *mut T)
         // CHECK: [[b:_.*]] = &raw mut [[a]];
         // CHECK: [[d:_.*]] = &[[b]];
         // FIXME this could be [[a]]
-        // CHECK: [[c:_.*]] = (*[[b]]);
+        // CHECK: [[c:_.*]] = copy (*[[b]]);
 
         let mut a = 5_usize;
         let b = &raw mut a;
@@ -638,7 +638,7 @@ fn reference_propagation_mut_ptr<T: Copy>(single: *mut T, mut multiple: *mut T)
         // CHECK: [[b:_.*]] = &raw mut [[a]];
         // CHECK: [[d:_.*]] = &mut [[b]];
         // FIXME this could be [[a]]
-        // CHECK: [[c:_.*]] = (*[[b]]);
+        // CHECK: [[c:_.*]] = copy (*[[b]]);
 
         let mut a = 5_usize;
         let mut b = &raw mut a;
@@ -652,8 +652,8 @@ fn reference_propagation_mut_ptr<T: Copy>(single: *mut T, mut multiple: *mut T)
 fn read_through_raw(x: &mut usize) -> usize {
     // CHECK-LABEL: read_through_raw
     // CHECK: bb0: {
-    // CHECK-NEXT: _0 = (*_1);
-    // CHECK-NEXT: _0 = (*_1);
+    // CHECK-NEXT: _0 = copy (*_1);
+    // CHECK-NEXT: _0 = copy (*_1);
     // CHECK-NEXT: return;
 
     use std::intrinsics::mir::*;
@@ -679,7 +679,7 @@ fn read_through_raw(x: &mut usize) -> usize {
 #[custom_mir(dialect = "runtime", phase = "post-cleanup")]
 fn multiple_storage() {
     // CHECK-LABEL: multiple_storage
-    // CHECK: _3 = (*_2);
+    // CHECK: _3 = copy (*_2);
 
     use std::intrinsics::mir::*;
     mir! {
@@ -705,7 +705,7 @@ fn multiple_storage() {
 #[custom_mir(dialect = "runtime", phase = "post-cleanup")]
 fn dominate_storage() {
     // CHECK-LABEL: dominate_storage
-    // CHECK: _5 = (*_2);
+    // CHECK: _5 = copy (*_2);
 
     use std::intrinsics::mir::*;
     mir! {
@@ -797,12 +797,12 @@ fn unique_with_copies() {
     // CHECK: [[a:_.*]] = const 0_i32;
     // CHECK: [[x:_.*]] = &raw mut [[a]];
     // CHECK-NOT: [[a]]
-    // CHECK: [[tmp:_.*]] = (*[[x]]);
+    // CHECK: [[tmp:_.*]] = copy (*[[x]]);
     // CHECK-NEXT: opaque::<i32>(move [[tmp]])
     // CHECK-NOT: [[a]]
     // CHECK: StorageDead([[a]]);
     // CHECK-NOT: [[a]]
-    // CHECK: [[tmp:_.*]] = (*[[x]]);
+    // CHECK: [[tmp:_.*]] = copy (*[[x]]);
     // CHECK-NEXT: opaque::<i32>(move [[tmp]])
 
     let y = {