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