fork/rust
git clone https://git.julia.blue/fork/rust
49cae55760d
1.44.0
1- // MIR for `main` before SimplifyBranches-after-const-prop 2+ // MIR for `main` after SimplifyBranches-after-const-prop 3 4 fn main() -> () { 5 let mut _0: (); // return place in scope 0 at $DIR/simplify_if.rs:5:11: 5:11 6 let mut _1: bool; // in scope 0 at $DIR/simplify_if.rs:6:8: 6:13 7 let _2: (); // in scope 0 at $DIR/simplify_if.rs:7:9: 7:15 8 9 bb0: { 10 StorageLive(_1); // bb0[0]: scope 0 at $DIR/simplify_if.rs:6:8: 6:13 11 _1 = const false; // bb0[1]: scope 0 at $DIR/simplify_if.rs:6:8: 6:13 12 // ty::Const 13 // + ty: bool 14 // + val: Value(Scalar(0x00)) 15 // mir::Constant 16 // + span: $DIR/simplify_if.rs:6:8: 6:13 17 // + literal: Const { ty: bool, val: Value(Scalar(0x00)) } 18- switchInt(const false) -> [false: bb1, otherwise: bb2]; // bb0[2]: scope 0 at $DIR/simplify_if.rs:6:5: 8:6 19- // ty::Const 20- // + ty: bool 21- // + val: Value(Scalar(0x00)) 22- // mir::Constant 23- // + span: $DIR/simplify_if.rs:6:5: 8:6 24- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) } 25+ goto -> bb1; // bb0[2]: scope 0 at $DIR/simplify_if.rs:6:5: 8:6 26 } 27 28 bb1: { 29 _0 = const (); // bb1[0]: scope 0 at $DIR/simplify_if.rs:6:5: 8:6 30 // ty::Const 31 // + ty: () 32 // + val: Value(Scalar(<ZST>)) 33 // mir::Constant 34 // + span: $DIR/simplify_if.rs:6:5: 8:6 35 // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) } 36 goto -> bb4; // bb1[1]: scope 0 at $DIR/simplify_if.rs:6:5: 8:6 37 } 38 39 bb2: { 40 StorageLive(_2); // bb2[0]: scope 0 at $DIR/simplify_if.rs:7:9: 7:15 41 _2 = const noop() -> bb3; // bb2[1]: scope 0 at $DIR/simplify_if.rs:7:9: 7:15 42 // ty::Const 43 // + ty: fn() {noop} 44 // + val: Value(Scalar(<ZST>)) 45 // mir::Constant 46 // + span: $DIR/simplify_if.rs:7:9: 7:13 47 // + literal: Const { ty: fn() {noop}, val: Value(Scalar(<ZST>)) } 48 } 49 50 bb3: { 51 StorageDead(_2); // bb3[0]: scope 0 at $DIR/simplify_if.rs:7:15: 7:16 52 _0 = const (); // bb3[1]: scope 0 at $DIR/simplify_if.rs:6:14: 8:6 53 // ty::Const 54 // + ty: () 55 // + val: Value(Scalar(<ZST>)) 56 // mir::Constant 57 // + span: $DIR/simplify_if.rs:6:14: 8:6 58 // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) } 59 goto -> bb4; // bb3[2]: scope 0 at $DIR/simplify_if.rs:6:5: 8:6 60 } 61 62 bb4: { 63 StorageDead(_1); // bb4[0]: scope 0 at $DIR/simplify_if.rs:9:1: 9:2 64 return; // bb4[1]: scope 0 at $DIR/simplify_if.rs:9:2: 9:2 65 } 66 } 67