|
| 1 | +- // MIR for `norm2` before InstSimplify |
| 2 | ++ // MIR for `norm2` after InstSimplify |
| 3 | + |
| 4 | + fn norm2(_1: [f32; 2]) -> f32 { |
| 5 | + debug x => _1; // in scope 0 at $DIR/combine_array_len.rs:+0:10: +0:11 |
| 6 | + let mut _0: f32; // return place in scope 0 at $DIR/combine_array_len.rs:+0:26: +0:29 |
| 7 | + let _2: f32; // in scope 0 at $DIR/combine_array_len.rs:+1:9: +1:10 |
| 8 | + let _3: usize; // in scope 0 at $DIR/combine_array_len.rs:+1:15: +1:16 |
| 9 | + let mut _4: usize; // in scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17 |
| 10 | + let mut _5: bool; // in scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17 |
| 11 | + let _7: usize; // in scope 0 at $DIR/combine_array_len.rs:+2:15: +2:16 |
| 12 | + let mut _8: usize; // in scope 0 at $DIR/combine_array_len.rs:+2:13: +2:17 |
| 13 | + let mut _9: bool; // in scope 0 at $DIR/combine_array_len.rs:+2:13: +2:17 |
| 14 | + let mut _10: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:5: +3:8 |
| 15 | + let mut _11: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:5: +3:6 |
| 16 | + let mut _12: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:7: +3:8 |
| 17 | + let mut _13: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:11: +3:14 |
| 18 | + let mut _14: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:11: +3:12 |
| 19 | + let mut _15: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:13: +3:14 |
| 20 | + scope 1 { |
| 21 | + debug a => _2; // in scope 1 at $DIR/combine_array_len.rs:+1:9: +1:10 |
| 22 | + let _6: f32; // in scope 1 at $DIR/combine_array_len.rs:+2:9: +2:10 |
| 23 | + scope 2 { |
| 24 | + debug b => _6; // in scope 2 at $DIR/combine_array_len.rs:+2:9: +2:10 |
| 25 | + } |
| 26 | + } |
| 27 | + |
| 28 | + bb0: { |
| 29 | + StorageLive(_2); // scope 0 at $DIR/combine_array_len.rs:+1:9: +1:10 |
| 30 | + StorageLive(_3); // scope 0 at $DIR/combine_array_len.rs:+1:15: +1:16 |
| 31 | + _3 = const 0_usize; // scope 0 at $DIR/combine_array_len.rs:+1:15: +1:16 |
| 32 | +- _4 = Len(_1); // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17 |
| 33 | ++ _4 = const 2_usize; // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17 |
| 34 | + _5 = Lt(_3, _4); // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17 |
| 35 | + assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable]; // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17 |
| 36 | + } |
| 37 | + |
| 38 | + bb1: { |
| 39 | + _2 = _1[_3]; // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17 |
| 40 | + StorageDead(_3); // scope 0 at $DIR/combine_array_len.rs:+1:17: +1:18 |
| 41 | + StorageLive(_6); // scope 1 at $DIR/combine_array_len.rs:+2:9: +2:10 |
| 42 | + StorageLive(_7); // scope 1 at $DIR/combine_array_len.rs:+2:15: +2:16 |
| 43 | + _7 = const 1_usize; // scope 1 at $DIR/combine_array_len.rs:+2:15: +2:16 |
| 44 | +- _8 = Len(_1); // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17 |
| 45 | ++ _8 = const 2_usize; // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17 |
| 46 | + _9 = Lt(_7, _8); // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17 |
| 47 | + assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb2, unwind unreachable]; // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17 |
| 48 | + } |
| 49 | + |
| 50 | + bb2: { |
| 51 | + _6 = _1[_7]; // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17 |
| 52 | + StorageDead(_7); // scope 1 at $DIR/combine_array_len.rs:+2:17: +2:18 |
| 53 | + StorageLive(_10); // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:8 |
| 54 | + StorageLive(_11); // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:6 |
| 55 | + _11 = _2; // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:6 |
| 56 | + StorageLive(_12); // scope 2 at $DIR/combine_array_len.rs:+3:7: +3:8 |
| 57 | + _12 = _2; // scope 2 at $DIR/combine_array_len.rs:+3:7: +3:8 |
| 58 | + _10 = Mul(move _11, move _12); // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:8 |
| 59 | + StorageDead(_12); // scope 2 at $DIR/combine_array_len.rs:+3:7: +3:8 |
| 60 | + StorageDead(_11); // scope 2 at $DIR/combine_array_len.rs:+3:7: +3:8 |
| 61 | + StorageLive(_13); // scope 2 at $DIR/combine_array_len.rs:+3:11: +3:14 |
| 62 | + StorageLive(_14); // scope 2 at $DIR/combine_array_len.rs:+3:11: +3:12 |
| 63 | + _14 = _6; // scope 2 at $DIR/combine_array_len.rs:+3:11: +3:12 |
| 64 | + StorageLive(_15); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14 |
| 65 | + _15 = _6; // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14 |
| 66 | + _13 = Mul(move _14, move _15); // scope 2 at $DIR/combine_array_len.rs:+3:11: +3:14 |
| 67 | + StorageDead(_15); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14 |
| 68 | + StorageDead(_14); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14 |
| 69 | + _0 = Add(move _10, move _13); // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:14 |
| 70 | + StorageDead(_13); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14 |
| 71 | + StorageDead(_10); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14 |
| 72 | + StorageDead(_6); // scope 1 at $DIR/combine_array_len.rs:+4:1: +4:2 |
| 73 | + StorageDead(_2); // scope 0 at $DIR/combine_array_len.rs:+4:1: +4:2 |
| 74 | + return; // scope 0 at $DIR/combine_array_len.rs:+4:2: +4:2 |
| 75 | + } |
| 76 | + } |
| 77 | + |
0 commit comments