|
| 1 | +- // MIR for `opt_has_later_use` before InstCombine |
| 2 | ++ // MIR for `opt_has_later_use` after InstCombine |
| 3 | + |
| 4 | + fn opt_has_later_use(_1: Vec<u8>) -> u8 { |
| 5 | + debug x => _1; // in scope 0 at $DIR/eq_not.rs:12:22: 12:23 |
| 6 | + let mut _0: u8; // return place in scope 0 at $DIR/eq_not.rs:12:37: 12:39 |
| 7 | + let _2: (); // in scope 0 at $DIR/eq_not.rs:13:5: 13:27 |
| 8 | + let mut _3: bool; // in scope 0 at $DIR/eq_not.rs:13:5: 13:27 |
| 9 | + let mut _4: bool; // in scope 0 at $DIR/eq_not.rs:13:13: 13:25 |
| 10 | + let mut _5: usize; // in scope 0 at $DIR/eq_not.rs:13:13: 13:20 |
| 11 | + let mut _6: &std::vec::Vec<u8>; // in scope 0 at $DIR/eq_not.rs:13:13: 13:14 |
| 12 | + let mut _7: !; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL |
| 13 | + let mut _8: &u8; // in scope 0 at $DIR/eq_not.rs:14:5: 14:9 |
| 14 | + let mut _9: &std::vec::Vec<u8>; // in scope 0 at $DIR/eq_not.rs:14:5: 14:6 |
| 15 | + scope 1 { |
| 16 | + debug self => _6; // in scope 1 at $SRC_DIR/alloc/src/vec.rs:LL:COL |
| 17 | + } |
| 18 | + |
| 19 | + bb0: { |
| 20 | + StorageLive(_2); // scope 0 at $DIR/eq_not.rs:13:5: 13:27 |
| 21 | + StorageLive(_3); // scope 0 at $DIR/eq_not.rs:13:5: 13:27 |
| 22 | + StorageLive(_4); // scope 0 at $DIR/eq_not.rs:13:13: 13:25 |
| 23 | + StorageLive(_5); // scope 0 at $DIR/eq_not.rs:13:13: 13:20 |
| 24 | + StorageLive(_6); // scope 0 at $DIR/eq_not.rs:13:13: 13:14 |
| 25 | + _6 = &_1; // scope 0 at $DIR/eq_not.rs:13:13: 13:14 |
| 26 | + _5 = ((*_6).1: usize); // scope 1 at $SRC_DIR/alloc/src/vec.rs:LL:COL |
| 27 | + StorageDead(_6); // scope 0 at $DIR/eq_not.rs:13:19: 13:20 |
| 28 | + _4 = Eq(move _5, const 2_usize); // scope 0 at $DIR/eq_not.rs:13:13: 13:25 |
| 29 | + StorageDead(_5); // scope 0 at $DIR/eq_not.rs:13:24: 13:25 |
| 30 | + _3 = Not(move _4); // scope 0 at $DIR/eq_not.rs:13:5: 13:27 |
| 31 | + StorageDead(_4); // scope 0 at $DIR/eq_not.rs:13:26: 13:27 |
| 32 | + switchInt(_3) -> [false: bb3, otherwise: bb4]; // scope 0 at $DIR/eq_not.rs:13:5: 13:27 |
| 33 | + } |
| 34 | + |
| 35 | + bb1 (cleanup): { |
| 36 | + resume; // scope 0 at $DIR/eq_not.rs:12:1: 15:2 |
| 37 | + } |
| 38 | + |
| 39 | + bb2 (cleanup): { |
| 40 | + drop(_1) -> bb1; // scope 0 at $DIR/eq_not.rs:15:1: 15:2 |
| 41 | + } |
| 42 | + |
| 43 | + bb3: { |
| 44 | + _2 = const (); // scope 0 at $DIR/eq_not.rs:13:5: 13:27 |
| 45 | + StorageDead(_3); // scope 0 at $DIR/eq_not.rs:13:26: 13:27 |
| 46 | + StorageDead(_2); // scope 0 at $DIR/eq_not.rs:13:26: 13:27 |
| 47 | + StorageLive(_8); // scope 0 at $DIR/eq_not.rs:14:5: 14:9 |
| 48 | + StorageLive(_9); // scope 0 at $DIR/eq_not.rs:14:5: 14:6 |
| 49 | + _9 = &_1; // scope 0 at $DIR/eq_not.rs:14:5: 14:6 |
| 50 | + _8 = <Vec<u8> as Index<usize>>::index(move _9, const 0_usize) -> [return: bb5, unwind: bb2]; // scope 0 at $DIR/eq_not.rs:14:5: 14:9 |
| 51 | + // mir::Constant |
| 52 | + // + span: $DIR/eq_not.rs:14:5: 14:9 |
| 53 | + // + literal: Const { ty: for<'r> fn(&'r std::vec::Vec<u8>, usize) -> &'r <std::vec::Vec<u8> as std::ops::Index<usize>>::Output {<std::vec::Vec<u8> as std::ops::Index<usize>>::index}, val: Value(Scalar(<ZST>)) } |
| 54 | + } |
| 55 | + |
| 56 | + bb4: { |
| 57 | + StorageLive(_7); // scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL |
| 58 | + begin_panic::<&str>(const "assertion failed: x.len() == 2") -> bb2; // scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL |
| 59 | + // mir::Constant |
| 60 | + // + span: $SRC_DIR/std/src/macros.rs:LL:COL |
| 61 | + // + literal: Const { ty: fn(&str) -> ! {std::rt::begin_panic::<&str>}, val: Value(Scalar(<ZST>)) } |
| 62 | + // ty::Const |
| 63 | + // + ty: &str |
| 64 | + // + val: Value(Slice { data: Allocation { bytes: [97, 115, 115, 101, 114, 116, 105, 111, 110, 32, 102, 97, 105, 108, 101, 100, 58, 32, 120, 46, 108, 101, 110, 40, 41, 32, 61, 61, 32, 50], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1073741823], len: Size { raw: 30 } }, size: Size { raw: 30 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 30 }) |
| 65 | + // mir::Constant |
| 66 | + // + span: $DIR/eq_not.rs:1:1: 1:1 |
| 67 | + // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [97, 115, 115, 101, 114, 116, 105, 111, 110, 32, 102, 97, 105, 108, 101, 100, 58, 32, 120, 46, 108, 101, 110, 40, 41, 32, 61, 61, 32, 50], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1073741823], len: Size { raw: 30 } }, size: Size { raw: 30 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 30 }) } |
| 68 | + } |
| 69 | + |
| 70 | + bb5: { |
| 71 | + _0 = (*_8); // scope 0 at $DIR/eq_not.rs:14:5: 14:9 |
| 72 | + StorageDead(_9); // scope 0 at $DIR/eq_not.rs:14:8: 14:9 |
| 73 | + StorageDead(_8); // scope 0 at $DIR/eq_not.rs:15:1: 15:2 |
| 74 | + drop(_1) -> [return: bb6, unwind: bb1]; // scope 0 at $DIR/eq_not.rs:15:1: 15:2 |
| 75 | + } |
| 76 | + |
| 77 | + bb6: { |
| 78 | + return; // scope 0 at $DIR/eq_not.rs:15:2: 15:2 |
| 79 | + } |
| 80 | + } |
| 81 | + |
0 commit comments