|
| 1 | +// MIR for `demo_ge_partial` after PreCodegen |
| 2 | + |
| 3 | +fn demo_ge_partial(_1: &(f32, f32), _2: &(f32, f32)) -> bool { |
| 4 | + debug a => _1; |
| 5 | + debug b => _2; |
| 6 | + let mut _0: bool; |
| 7 | + scope 1 (inlined std::cmp::impls::<impl PartialOrd for &(f32, f32)>::le) { |
| 8 | + scope 2 (inlined core::tuple::<impl PartialOrd for (f32, f32)>::le) { |
| 9 | + let mut _12: bool; |
| 10 | + let _15: std::option::Option<std::cmp::Ordering>; |
| 11 | + let _19: &f32; |
| 12 | + let _20: &f32; |
| 13 | + scope 3 { |
| 14 | + let mut _9: &std::option::Option<std::cmp::Ordering>; |
| 15 | + let mut _13: &std::option::Option<std::cmp::Ordering>; |
| 16 | + scope 4 (inlined <Option<std::cmp::Ordering> as PartialEq>::ne) { |
| 17 | + let mut _11: bool; |
| 18 | + scope 5 (inlined <Option<std::cmp::Ordering> as PartialEq>::eq) { |
| 19 | + let mut _10: isize; |
| 20 | + let mut _16: isize; |
| 21 | + scope 6 { |
| 22 | + scope 7 (inlined <std::cmp::Ordering as PartialEq>::eq) { |
| 23 | + let _17: i8; |
| 24 | + scope 8 { |
| 25 | + let _18: i8; |
| 26 | + scope 9 { |
| 27 | + } |
| 28 | + } |
| 29 | + } |
| 30 | + } |
| 31 | + } |
| 32 | + } |
| 33 | + scope 10 (inlined <Option<std::cmp::Ordering> as PartialEq>::eq) { |
| 34 | + let mut _14: isize; |
| 35 | + let mut _21: isize; |
| 36 | + scope 11 { |
| 37 | + scope 12 (inlined <std::cmp::Ordering as PartialEq>::eq) { |
| 38 | + let _22: i8; |
| 39 | + scope 13 { |
| 40 | + let _23: i8; |
| 41 | + scope 14 { |
| 42 | + } |
| 43 | + } |
| 44 | + } |
| 45 | + } |
| 46 | + } |
| 47 | + } |
| 48 | + scope 15 (inlined std::cmp::impls::<impl PartialOrd for f32>::partial_cmp) { |
| 49 | + let mut _3: f32; |
| 50 | + let mut _4: f32; |
| 51 | + let mut _5: bool; |
| 52 | + let mut _6: f32; |
| 53 | + let mut _7: f32; |
| 54 | + let mut _8: bool; |
| 55 | + } |
| 56 | + } |
| 57 | + } |
| 58 | + |
| 59 | + bb0: { |
| 60 | + StorageLive(_19); |
| 61 | + StorageLive(_20); |
| 62 | + StorageLive(_13); |
| 63 | + StorageLive(_9); |
| 64 | + StorageLive(_15); |
| 65 | + StorageLive(_5); |
| 66 | + StorageLive(_8); |
| 67 | + StorageLive(_3); |
| 68 | + _3 = copy ((*_1).0: f32); |
| 69 | + StorageLive(_4); |
| 70 | + _4 = copy ((*_2).0: f32); |
| 71 | + _5 = Le(move _3, move _4); |
| 72 | + StorageDead(_4); |
| 73 | + StorageDead(_3); |
| 74 | + StorageLive(_6); |
| 75 | + _6 = copy ((*_1).0: f32); |
| 76 | + StorageLive(_7); |
| 77 | + _7 = copy ((*_2).0: f32); |
| 78 | + _8 = Ge(move _6, move _7); |
| 79 | + StorageDead(_7); |
| 80 | + StorageDead(_6); |
| 81 | + switchInt(copy _5) -> [0: bb1, otherwise: bb5]; |
| 82 | + } |
| 83 | + |
| 84 | + bb1: { |
| 85 | + switchInt(copy _8) -> [0: bb2, otherwise: bb4]; |
| 86 | + } |
| 87 | + |
| 88 | + bb2: { |
| 89 | + StorageDead(_8); |
| 90 | + StorageDead(_5); |
| 91 | + StorageLive(_12); |
| 92 | + _9 = const core::tuple::<impl std::cmp::PartialOrd for (f32, f32)>::le::promoted[1]; |
| 93 | + StorageLive(_11); |
| 94 | + StorageLive(_16); |
| 95 | + StorageLive(_10); |
| 96 | + _10 = discriminant((*_9)); |
| 97 | + _11 = Eq(copy _10, const 0_isize); |
| 98 | + StorageDead(_10); |
| 99 | + StorageDead(_16); |
| 100 | + _12 = Not(move _11); |
| 101 | + StorageDead(_11); |
| 102 | + switchInt(move _12) -> [0: bb11, otherwise: bb3]; |
| 103 | + } |
| 104 | + |
| 105 | + bb3: { |
| 106 | + _13 = const core::tuple::<impl std::cmp::PartialOrd for (f32, f32)>::le::promoted[0]; |
| 107 | + StorageLive(_21); |
| 108 | + StorageLive(_14); |
| 109 | + _14 = discriminant((*_13)); |
| 110 | + _0 = Eq(copy _14, const 0_isize); |
| 111 | + goto -> bb16; |
| 112 | + } |
| 113 | + |
| 114 | + bb4: { |
| 115 | + _15 = const Option::<std::cmp::Ordering>::Some(Greater); |
| 116 | + StorageDead(_8); |
| 117 | + StorageDead(_5); |
| 118 | + StorageLive(_12); |
| 119 | + _9 = const core::tuple::<impl std::cmp::PartialOrd for (f32, f32)>::le::promoted[1]; |
| 120 | + StorageLive(_11); |
| 121 | + StorageLive(_16); |
| 122 | + StorageLive(_10); |
| 123 | + goto -> bb8; |
| 124 | + } |
| 125 | + |
| 126 | + bb5: { |
| 127 | + switchInt(copy _8) -> [0: bb6, otherwise: bb7]; |
| 128 | + } |
| 129 | + |
| 130 | + bb6: { |
| 131 | + _15 = const Option::<std::cmp::Ordering>::Some(Less); |
| 132 | + StorageDead(_8); |
| 133 | + StorageDead(_5); |
| 134 | + StorageLive(_12); |
| 135 | + _9 = const core::tuple::<impl std::cmp::PartialOrd for (f32, f32)>::le::promoted[1]; |
| 136 | + StorageLive(_11); |
| 137 | + StorageLive(_16); |
| 138 | + StorageLive(_10); |
| 139 | + goto -> bb8; |
| 140 | + } |
| 141 | + |
| 142 | + bb7: { |
| 143 | + _15 = const Option::<std::cmp::Ordering>::Some(Equal); |
| 144 | + StorageDead(_8); |
| 145 | + StorageDead(_5); |
| 146 | + StorageLive(_12); |
| 147 | + _9 = const core::tuple::<impl std::cmp::PartialOrd for (f32, f32)>::le::promoted[1]; |
| 148 | + StorageLive(_11); |
| 149 | + StorageLive(_16); |
| 150 | + StorageLive(_10); |
| 151 | + goto -> bb8; |
| 152 | + } |
| 153 | + |
| 154 | + bb8: { |
| 155 | + _16 = discriminant((*_9)); |
| 156 | + switchInt(move _16) -> [0: bb9, 1: bb10, otherwise: bb18]; |
| 157 | + } |
| 158 | + |
| 159 | + bb9: { |
| 160 | + StorageDead(_10); |
| 161 | + StorageDead(_16); |
| 162 | + StorageDead(_11); |
| 163 | + _13 = const core::tuple::<impl std::cmp::PartialOrd for (f32, f32)>::le::promoted[0]; |
| 164 | + StorageLive(_21); |
| 165 | + StorageLive(_14); |
| 166 | + goto -> bb13; |
| 167 | + } |
| 168 | + |
| 169 | + bb10: { |
| 170 | + StorageLive(_17); |
| 171 | + StorageLive(_18); |
| 172 | + _17 = discriminant(((_15 as Some).0: std::cmp::Ordering)); |
| 173 | + _18 = discriminant((((*_9) as Some).0: std::cmp::Ordering)); |
| 174 | + _11 = Eq(copy _17, copy _18); |
| 175 | + StorageDead(_18); |
| 176 | + StorageDead(_17); |
| 177 | + StorageDead(_10); |
| 178 | + StorageDead(_16); |
| 179 | + _12 = Not(move _11); |
| 180 | + StorageDead(_11); |
| 181 | + switchInt(move _12) -> [0: bb11, otherwise: bb12]; |
| 182 | + } |
| 183 | + |
| 184 | + bb11: { |
| 185 | + _19 = &((*_1).1: f32); |
| 186 | + _20 = &((*_2).1: f32); |
| 187 | + _0 = <f32 as PartialOrd>::le(move _19, move _20) -> [return: bb17, unwind continue]; |
| 188 | + } |
| 189 | + |
| 190 | + bb12: { |
| 191 | + _13 = const core::tuple::<impl std::cmp::PartialOrd for (f32, f32)>::le::promoted[0]; |
| 192 | + StorageLive(_21); |
| 193 | + StorageLive(_14); |
| 194 | + goto -> bb13; |
| 195 | + } |
| 196 | + |
| 197 | + bb13: { |
| 198 | + _21 = discriminant((*_13)); |
| 199 | + switchInt(move _21) -> [0: bb14, 1: bb15, otherwise: bb18]; |
| 200 | + } |
| 201 | + |
| 202 | + bb14: { |
| 203 | + _0 = const false; |
| 204 | + goto -> bb16; |
| 205 | + } |
| 206 | + |
| 207 | + bb15: { |
| 208 | + StorageLive(_22); |
| 209 | + StorageLive(_23); |
| 210 | + _22 = discriminant(((_15 as Some).0: std::cmp::Ordering)); |
| 211 | + _23 = discriminant((((*_13) as Some).0: std::cmp::Ordering)); |
| 212 | + _0 = Eq(copy _22, copy _23); |
| 213 | + StorageDead(_23); |
| 214 | + StorageDead(_22); |
| 215 | + goto -> bb16; |
| 216 | + } |
| 217 | + |
| 218 | + bb16: { |
| 219 | + StorageDead(_14); |
| 220 | + StorageDead(_21); |
| 221 | + goto -> bb17; |
| 222 | + } |
| 223 | + |
| 224 | + bb17: { |
| 225 | + StorageDead(_12); |
| 226 | + StorageDead(_15); |
| 227 | + StorageDead(_9); |
| 228 | + StorageDead(_13); |
| 229 | + StorageDead(_20); |
| 230 | + StorageDead(_19); |
| 231 | + return; |
| 232 | + } |
| 233 | + |
| 234 | + bb18: { |
| 235 | + unreachable; |
| 236 | + } |
| 237 | +} |
0 commit comments