|
| 1 | +- // MIR for `wide_ptr_integer` before GVN |
| 2 | ++ // MIR for `wide_ptr_integer` after GVN |
| 3 | + |
| 4 | + fn wide_ptr_integer() -> () { |
| 5 | + let mut _0: (); |
| 6 | + let _1: *const [u8]; |
| 7 | + let mut _2: (usize, usize); |
| 8 | + let mut _4: (usize, usize); |
| 9 | + let _5: (); |
| 10 | + let mut _6: bool; |
| 11 | + let mut _7: *const [u8]; |
| 12 | + let mut _8: *const [u8]; |
| 13 | + let _9: (); |
| 14 | + let mut _10: bool; |
| 15 | + let mut _11: *const [u8]; |
| 16 | + let mut _12: *const [u8]; |
| 17 | + let _13: (); |
| 18 | + let mut _14: bool; |
| 19 | + let mut _15: *const [u8]; |
| 20 | + let mut _16: *const [u8]; |
| 21 | + let _17: (); |
| 22 | + let mut _18: bool; |
| 23 | + let mut _19: *const [u8]; |
| 24 | + let mut _20: *const [u8]; |
| 25 | + let _21: (); |
| 26 | + let mut _22: bool; |
| 27 | + let mut _23: *const [u8]; |
| 28 | + let mut _24: *const [u8]; |
| 29 | + let _25: (); |
| 30 | + let mut _26: bool; |
| 31 | + let mut _27: *const [u8]; |
| 32 | + let mut _28: *const [u8]; |
| 33 | + scope 1 { |
| 34 | + debug a => _1; |
| 35 | + let _3: *const [u8]; |
| 36 | + scope 3 { |
| 37 | + debug b => _3; |
| 38 | + } |
| 39 | + scope 4 { |
| 40 | + } |
| 41 | + } |
| 42 | + scope 2 { |
| 43 | + } |
| 44 | + |
| 45 | + bb0: { |
| 46 | +- StorageLive(_1); |
| 47 | ++ nop; |
| 48 | + StorageLive(_2); |
| 49 | +- _2 = (const 1_usize, const 1_usize); |
| 50 | +- _1 = move _2 as *const [u8] (Transmute); |
| 51 | ++ _2 = const (1_usize, 1_usize); |
| 52 | ++ _1 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; |
| 53 | + StorageDead(_2); |
| 54 | +- StorageLive(_3); |
| 55 | ++ nop; |
| 56 | + StorageLive(_4); |
| 57 | +- _4 = (const 1_usize, const 2_usize); |
| 58 | +- _3 = move _4 as *const [u8] (Transmute); |
| 59 | ++ _4 = const (1_usize, 2_usize); |
| 60 | ++ _3 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; |
| 61 | + StorageDead(_4); |
| 62 | + StorageLive(_5); |
| 63 | + StorageLive(_6); |
| 64 | + StorageLive(_7); |
| 65 | +- _7 = _1; |
| 66 | ++ _7 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; |
| 67 | + StorageLive(_8); |
| 68 | +- _8 = _3; |
| 69 | +- _6 = Eq(move _7, move _8); |
| 70 | ++ _8 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; |
| 71 | ++ _6 = const false; |
| 72 | + StorageDead(_8); |
| 73 | + StorageDead(_7); |
| 74 | +- _5 = opaque::<bool>(move _6) -> [return: bb1, unwind unreachable]; |
| 75 | ++ _5 = opaque::<bool>(const false) -> [return: bb1, unwind unreachable]; |
| 76 | + } |
| 77 | + |
| 78 | + bb1: { |
| 79 | + StorageDead(_6); |
| 80 | + StorageDead(_5); |
| 81 | + StorageLive(_9); |
| 82 | + StorageLive(_10); |
| 83 | + StorageLive(_11); |
| 84 | +- _11 = _1; |
| 85 | ++ _11 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; |
| 86 | + StorageLive(_12); |
| 87 | +- _12 = _3; |
| 88 | +- _10 = Ne(move _11, move _12); |
| 89 | ++ _12 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; |
| 90 | ++ _10 = const true; |
| 91 | + StorageDead(_12); |
| 92 | + StorageDead(_11); |
| 93 | +- _9 = opaque::<bool>(move _10) -> [return: bb2, unwind unreachable]; |
| 94 | ++ _9 = opaque::<bool>(const true) -> [return: bb2, unwind unreachable]; |
| 95 | + } |
| 96 | + |
| 97 | + bb2: { |
| 98 | + StorageDead(_10); |
| 99 | + StorageDead(_9); |
| 100 | + StorageLive(_13); |
| 101 | + StorageLive(_14); |
| 102 | + StorageLive(_15); |
| 103 | +- _15 = _1; |
| 104 | ++ _15 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; |
| 105 | + StorageLive(_16); |
| 106 | +- _16 = _3; |
| 107 | +- _14 = Lt(move _15, move _16); |
| 108 | ++ _16 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; |
| 109 | ++ _14 = const true; |
| 110 | + StorageDead(_16); |
| 111 | + StorageDead(_15); |
| 112 | +- _13 = opaque::<bool>(move _14) -> [return: bb3, unwind unreachable]; |
| 113 | ++ _13 = opaque::<bool>(const true) -> [return: bb3, unwind unreachable]; |
| 114 | + } |
| 115 | + |
| 116 | + bb3: { |
| 117 | + StorageDead(_14); |
| 118 | + StorageDead(_13); |
| 119 | + StorageLive(_17); |
| 120 | + StorageLive(_18); |
| 121 | + StorageLive(_19); |
| 122 | +- _19 = _1; |
| 123 | ++ _19 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; |
| 124 | + StorageLive(_20); |
| 125 | +- _20 = _3; |
| 126 | +- _18 = Le(move _19, move _20); |
| 127 | ++ _20 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; |
| 128 | ++ _18 = const true; |
| 129 | + StorageDead(_20); |
| 130 | + StorageDead(_19); |
| 131 | +- _17 = opaque::<bool>(move _18) -> [return: bb4, unwind unreachable]; |
| 132 | ++ _17 = opaque::<bool>(const true) -> [return: bb4, unwind unreachable]; |
| 133 | + } |
| 134 | + |
| 135 | + bb4: { |
| 136 | + StorageDead(_18); |
| 137 | + StorageDead(_17); |
| 138 | + StorageLive(_21); |
| 139 | + StorageLive(_22); |
| 140 | + StorageLive(_23); |
| 141 | +- _23 = _1; |
| 142 | ++ _23 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; |
| 143 | + StorageLive(_24); |
| 144 | +- _24 = _3; |
| 145 | +- _22 = Gt(move _23, move _24); |
| 146 | ++ _24 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; |
| 147 | ++ _22 = const false; |
| 148 | + StorageDead(_24); |
| 149 | + StorageDead(_23); |
| 150 | +- _21 = opaque::<bool>(move _22) -> [return: bb5, unwind unreachable]; |
| 151 | ++ _21 = opaque::<bool>(const false) -> [return: bb5, unwind unreachable]; |
| 152 | + } |
| 153 | + |
| 154 | + bb5: { |
| 155 | + StorageDead(_22); |
| 156 | + StorageDead(_21); |
| 157 | + StorageLive(_25); |
| 158 | + StorageLive(_26); |
| 159 | + StorageLive(_27); |
| 160 | +- _27 = _1; |
| 161 | ++ _27 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; |
| 162 | + StorageLive(_28); |
| 163 | +- _28 = _3; |
| 164 | +- _26 = Ge(move _27, move _28); |
| 165 | ++ _28 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; |
| 166 | ++ _26 = const false; |
| 167 | + StorageDead(_28); |
| 168 | + StorageDead(_27); |
| 169 | +- _25 = opaque::<bool>(move _26) -> [return: bb6, unwind unreachable]; |
| 170 | ++ _25 = opaque::<bool>(const false) -> [return: bb6, unwind unreachable]; |
| 171 | + } |
| 172 | + |
| 173 | + bb6: { |
| 174 | + StorageDead(_26); |
| 175 | + StorageDead(_25); |
| 176 | + _0 = const (); |
| 177 | +- StorageDead(_3); |
| 178 | +- StorageDead(_1); |
| 179 | ++ nop; |
| 180 | ++ nop; |
| 181 | + return; |
| 182 | + } |
| 183 | ++ } |
| 184 | ++ |
| 185 | ++ ALLOC1 (size: 16, align: 8) { |
| 186 | ++ 01 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 │ ................ |
| 187 | ++ } |
| 188 | ++ |
| 189 | ++ ALLOC0 (size: 16, align: 8) { |
| 190 | ++ 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 │ ................ |
| 191 | + } |
| 192 | + |
0 commit comments