fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1- // MIR for `foo` before MatchBranchSimplification 2+ // MIR for `foo` after MatchBranchSimplification 3 4 fn foo(_1: [u8; 16]) -> Option<[u8; 4]> { 5 debug bytes => _1; 6 let mut _0: std::option::Option<[u8; 4]>; 7 let _2: [u32; 4]; 8 let mut _3: [u8; 16]; 9 let mut _5: [u8; 4]; 10 let mut _6: u32; 11 scope 1 { 12 debug dwords => _2; 13 scope 3 { 14 debug ip => _4; 15 let _4: u32; 16 scope 4 { 17 } 18 } 19 } 20 scope 2 { 21 } 22 23 bb0: { 24 StorageLive(_2); 25 StorageLive(_3); 26 _3 = _1; 27 _2 = move _3 as [u32; 4] (Transmute); 28 StorageDead(_3); 29 switchInt(_2[0 of 4]) -> [0: bb1, otherwise: bb6]; 30 } 31 32 bb1: { 33 switchInt(_2[1 of 4]) -> [0: bb2, otherwise: bb6]; 34 } 35 36 bb2: { 37 switchInt(_2[2 of 4]) -> [0: bb4, 4294901760: bb5, otherwise: bb6]; 38 } 39 40 bb3: { 41 StorageLive(_5); 42 StorageLive(_6); 43 _6 = _4; 44 _5 = move _6 as [u8; 4] (Transmute); 45 StorageDead(_6); 46 _0 = Option::<[u8; 4]>::Some(move _5); 47 StorageDead(_5); 48 StorageDead(_4); 49 goto -> bb7; 50 } 51 52 bb4: { 53 StorageLive(_4); 54 _4 = _2[3 of 4]; 55 goto -> bb3; 56 } 57 58 bb5: { 59 StorageLive(_4); 60 _4 = _2[3 of 4]; 61 goto -> bb3; 62 } 63 64 bb6: { 65 _0 = Option::<[u8; 4]>::None; 66 goto -> bb7; 67 } 68 69 bb7: { 70 StorageDead(_2); 71 return; 72 } 73 } 74