1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
|
- // MIR for `enum_different_variant` before GVN
+ // MIR for `enum_different_variant` after GVN
fn enum_different_variant(_1: &Enum1) -> Enum1 {
debug v => _1;
let mut _0: Enum1;
let mut _2: isize;
let _3: &AllCopy;
let mut _8: i32;
let mut _9: u64;
let mut _10: [i8; 3];
let mut _11: AllCopy;
let _12: &AllCopy;
let mut _17: i32;
let mut _18: u64;
let mut _19: [i8; 3];
let mut _20: AllCopy;
scope 1 {
debug v => _3;
let _4: i32;
scope 2 {
debug a => _4;
let _5: u64;
scope 3 {
debug b => _5;
let _6: [i8; 3];
scope 4 {
debug c => _6;
let _7: AllCopy;
scope 5 {
debug all_copy => _7;
}
}
}
}
}
scope 6 {
debug v => _12;
let _13: i32;
scope 7 {
debug a => _13;
let _14: u64;
scope 8 {
debug b => _14;
let _15: [i8; 3];
scope 9 {
debug c => _15;
let _16: AllCopy;
scope 10 {
debug all_copy => _16;
}
}
}
}
}
bb0: {
_2 = discriminant((*_1));
switchInt(move _2) -> [0: bb3, 1: bb2, otherwise: bb1];
}
bb1: {
unreachable;
}
bb2: {
StorageLive(_12);
_12 = &(((*_1) as B).0: AllCopy);
- StorageLive(_13);
- _13 = copy ((*_12).0: i32);
- StorageLive(_14);
- _14 = copy ((*_12).1: u64);
- StorageLive(_15);
- _15 = copy ((*_12).2: [i8; 3]);
- StorageLive(_16);
+ nop;
+ _13 = copy ((((*_1) as B).0: AllCopy).0: i32);
+ nop;
+ _14 = copy ((((*_1) as B).0: AllCopy).1: u64);
+ nop;
+ _15 = copy ((((*_1) as B).0: AllCopy).2: [i8; 3]);
+ nop;
StorageLive(_17);
_17 = copy _13;
StorageLive(_18);
_18 = copy _14;
StorageLive(_19);
_19 = copy _15;
- _16 = AllCopy { a: move _17, b: move _18, c: move _19 };
+ _16 = copy (((*_1) as B).0: AllCopy);
StorageDead(_19);
StorageDead(_18);
StorageDead(_17);
StorageLive(_20);
- _20 = move _16;
- _0 = Enum1::A(move _20);
+ _20 = copy _16;
+ _0 = Enum1::A(copy _16);
StorageDead(_20);
- StorageDead(_16);
- StorageDead(_15);
- StorageDead(_14);
- StorageDead(_13);
+ nop;
+ nop;
+ nop;
+ nop;
StorageDead(_12);
goto -> bb4;
}
bb3: {
StorageLive(_3);
_3 = &(((*_1) as A).0: AllCopy);
- StorageLive(_4);
- _4 = copy ((*_3).0: i32);
- StorageLive(_5);
- _5 = copy ((*_3).1: u64);
- StorageLive(_6);
- _6 = copy ((*_3).2: [i8; 3]);
- StorageLive(_7);
+ nop;
+ _4 = copy ((((*_1) as A).0: AllCopy).0: i32);
+ nop;
+ _5 = copy ((((*_1) as A).0: AllCopy).1: u64);
+ nop;
+ _6 = copy ((((*_1) as A).0: AllCopy).2: [i8; 3]);
+ nop;
StorageLive(_8);
_8 = copy _4;
StorageLive(_9);
_9 = copy _5;
StorageLive(_10);
_10 = copy _6;
- _7 = AllCopy { a: move _8, b: move _9, c: move _10 };
+ _7 = copy (((*_1) as A).0: AllCopy);
StorageDead(_10);
StorageDead(_9);
StorageDead(_8);
StorageLive(_11);
- _11 = move _7;
- _0 = Enum1::B(move _11);
+ _11 = copy _7;
+ _0 = Enum1::B(copy _7);
StorageDead(_11);
- StorageDead(_7);
- StorageDead(_6);
- StorageDead(_5);
- StorageDead(_4);
+ nop;
+ nop;
+ nop;
+ nop;
StorageDead(_3);
goto -> bb4;
}
bb4: {
return;
}
}
|