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 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307
|
- // MIR for `slices` before GVN
+ // MIR for `slices` after GVN
fn slices() -> () {
let mut _0: ();
let _1: &str;
let _2: ();
let mut _3: &str;
let _5: ();
let mut _6: &str;
let _7: ();
let mut _8: (&*const u8, &*const u8);
let mut _9: &*const u8;
let _10: *const u8;
let mut _11: &str;
let mut _12: &*const u8;
let _13: *const u8;
let mut _14: &str;
let mut _17: bool;
let mut _18: *const u8;
let mut _19: *const u8;
let mut _20: !;
let _22: !;
let mut _23: core::panicking::AssertKind;
let mut _24: &*const u8;
let _25: &*const u8;
let mut _26: &*const u8;
let _27: &*const u8;
let mut _28: std::option::Option<std::fmt::Arguments<'_>>;
let mut _30: &str;
let _31: ();
let mut _32: &[u8];
let _33: ();
let mut _34: (&*const u8, &*const u8);
let mut _35: &*const u8;
let _36: *const u8;
let mut _37: &str;
let mut _38: &*const u8;
let _39: *const u8;
let mut _40: &[u8];
let mut _43: bool;
let mut _44: *const u8;
let mut _45: *const u8;
let mut _46: !;
let _48: !;
let mut _49: core::panicking::AssertKind;
let mut _50: &*const u8;
let _51: &*const u8;
let mut _52: &*const u8;
let _53: &*const u8;
let mut _54: std::option::Option<std::fmt::Arguments<'_>>;
scope 1 {
debug s => _1;
let _4: &str;
scope 2 {
debug t => _4;
let _15: &*const u8;
let _16: &*const u8;
let _29: &[u8];
scope 3 {
debug left_val => _15;
debug right_val => _16;
let _21: core::panicking::AssertKind;
scope 4 {
debug kind => _21;
}
}
scope 5 {
debug u => _29;
let _41: &*const u8;
let _42: &*const u8;
scope 6 {
debug left_val => _41;
debug right_val => _42;
let _47: core::panicking::AssertKind;
scope 7 {
debug kind => _47;
}
}
}
}
}
bb0: {
- StorageLive(_1);
+ nop;
_1 = const "my favourite slice";
StorageLive(_2);
StorageLive(_3);
_3 = copy _1;
- _2 = opaque::<&str>(move _3) -> [return: bb1, unwind continue];
+ _2 = opaque::<&str>(copy _1) -> [return: bb1, unwind continue];
}
bb1: {
StorageDead(_3);
StorageDead(_2);
StorageLive(_4);
_4 = copy _1;
StorageLive(_5);
StorageLive(_6);
- _6 = copy _4;
- _5 = opaque::<&str>(move _6) -> [return: bb2, unwind continue];
+ _6 = copy _1;
+ _5 = opaque::<&str>(copy _1) -> [return: bb2, unwind continue];
}
bb2: {
StorageDead(_6);
StorageDead(_5);
StorageLive(_7);
StorageLive(_8);
- StorageLive(_9);
+ nop;
StorageLive(_10);
StorageLive(_11);
_11 = &(*_1);
_10 = core::str::<impl str>::as_ptr(move _11) -> [return: bb3, unwind continue];
}
bb3: {
StorageDead(_11);
_9 = &_10;
- StorageLive(_12);
+ nop;
StorageLive(_13);
StorageLive(_14);
- _14 = &(*_4);
+ _14 = &(*_1);
_13 = core::str::<impl str>::as_ptr(move _14) -> [return: bb4, unwind continue];
}
bb4: {
StorageDead(_14);
_12 = &_13;
- _8 = (move _9, move _12);
- StorageDead(_12);
- StorageDead(_9);
+ _8 = (copy _9, copy _12);
+ nop;
+ nop;
StorageLive(_15);
- _15 = copy (_8.0: &*const u8);
+ _15 = copy _9;
StorageLive(_16);
- _16 = copy (_8.1: &*const u8);
+ _16 = copy _12;
StorageLive(_17);
StorageLive(_18);
- _18 = copy (*_15);
+ _18 = copy (*_9);
StorageLive(_19);
- _19 = copy (*_16);
+ _19 = copy (*_12);
_17 = Eq(move _18, move _19);
switchInt(move _17) -> [0: bb6, otherwise: bb5];
}
bb5: {
StorageDead(_19);
StorageDead(_18);
_7 = const ();
StorageDead(_17);
StorageDead(_16);
StorageDead(_15);
StorageDead(_13);
StorageDead(_10);
StorageDead(_8);
StorageDead(_7);
- StorageLive(_29);
+ nop;
StorageLive(_30);
_30 = &(*_1);
_29 = move _30 as &[u8] (Transmute);
StorageDead(_30);
StorageLive(_31);
StorageLive(_32);
_32 = copy _29;
- _31 = opaque::<&[u8]>(move _32) -> [return: bb7, unwind continue];
+ _31 = opaque::<&[u8]>(copy _29) -> [return: bb7, unwind continue];
}
bb6: {
StorageDead(_19);
StorageDead(_18);
- StorageLive(_21);
- _21 = core::panicking::AssertKind::Eq;
+ nop;
+ _21 = const core::panicking::AssertKind::Eq;
StorageLive(_22);
StorageLive(_23);
- _23 = move _21;
+ _23 = const core::panicking::AssertKind::Eq;
StorageLive(_24);
StorageLive(_25);
- _25 = &(*_15);
+ _25 = &(*_9);
_24 = &(*_25);
StorageLive(_26);
StorageLive(_27);
- _27 = &(*_16);
+ _27 = &(*_12);
_26 = &(*_27);
StorageLive(_28);
_28 = Option::<Arguments<'_>>::None;
- _22 = assert_failed::<*const u8, *const u8>(move _23, move _24, move _26, move _28) -> unwind continue;
+ _22 = assert_failed::<*const u8, *const u8>(const core::panicking::AssertKind::Eq, move _24, move _26, move _28) -> unwind continue;
}
bb7: {
StorageDead(_32);
StorageDead(_31);
StorageLive(_33);
StorageLive(_34);
- StorageLive(_35);
+ nop;
StorageLive(_36);
StorageLive(_37);
_37 = &(*_1);
_36 = core::str::<impl str>::as_ptr(move _37) -> [return: bb8, unwind continue];
}
bb8: {
StorageDead(_37);
_35 = &_36;
- StorageLive(_38);
+ nop;
StorageLive(_39);
StorageLive(_40);
_40 = &(*_29);
_39 = core::slice::<impl [u8]>::as_ptr(move _40) -> [return: bb9, unwind continue];
}
bb9: {
StorageDead(_40);
_38 = &_39;
- _34 = (move _35, move _38);
- StorageDead(_38);
- StorageDead(_35);
+ _34 = (copy _35, copy _38);
+ nop;
+ nop;
StorageLive(_41);
- _41 = copy (_34.0: &*const u8);
+ _41 = copy _35;
StorageLive(_42);
- _42 = copy (_34.1: &*const u8);
+ _42 = copy _38;
StorageLive(_43);
StorageLive(_44);
- _44 = copy (*_41);
+ _44 = copy (*_35);
StorageLive(_45);
- _45 = copy (*_42);
+ _45 = copy (*_38);
_43 = Eq(move _44, move _45);
switchInt(move _43) -> [0: bb11, otherwise: bb10];
}
bb10: {
StorageDead(_45);
StorageDead(_44);
_33 = const ();
StorageDead(_43);
StorageDead(_42);
StorageDead(_41);
StorageDead(_39);
StorageDead(_36);
StorageDead(_34);
StorageDead(_33);
_0 = const ();
- StorageDead(_29);
+ nop;
StorageDead(_4);
- StorageDead(_1);
+ nop;
return;
}
bb11: {
StorageDead(_45);
StorageDead(_44);
- StorageLive(_47);
- _47 = core::panicking::AssertKind::Eq;
+ nop;
+ _47 = const core::panicking::AssertKind::Eq;
StorageLive(_48);
StorageLive(_49);
- _49 = move _47;
+ _49 = const core::panicking::AssertKind::Eq;
StorageLive(_50);
StorageLive(_51);
- _51 = &(*_41);
+ _51 = &(*_35);
_50 = &(*_51);
StorageLive(_52);
StorageLive(_53);
- _53 = &(*_42);
+ _53 = &(*_38);
_52 = &(*_53);
StorageLive(_54);
_54 = Option::<Arguments<'_>>::None;
- _48 = assert_failed::<*const u8, *const u8>(move _49, move _50, move _52, move _54) -> unwind continue;
+ _48 = assert_failed::<*const u8, *const u8>(const core::panicking::AssertKind::Eq, move _50, move _52, move _54) -> unwind continue;
}
}
|