]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff
Rollup merge of #107473 - rustbot:docs-update, r=ehuss
[rust.git] / tests / mir-opt / if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff
1 - // MIR for `opt_multiple_ifs` before SimplifyComparisonIntegral
2 + // MIR for `opt_multiple_ifs` after SimplifyComparisonIntegral
3   
4   fn opt_multiple_ifs(_1: u32) -> u32 {
5       debug x => _1;                       // in scope 0 at $DIR/if_condition_int.rs:+0:21: +0:22
6       let mut _0: u32;                     // return place in scope 0 at $DIR/if_condition_int.rs:+0:32: +0:35
7       let mut _2: bool;                    // in scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
8       let mut _3: u32;                     // in scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
9       let mut _4: bool;                    // in scope 0 at $DIR/if_condition_int.rs:+3:15: +3:22
10       let mut _5: u32;                     // in scope 0 at $DIR/if_condition_int.rs:+3:15: +3:16
11   
12       bb0: {
13           StorageLive(_2);                 // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
14           StorageLive(_3);                 // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
15           _3 = _1;                         // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:9
16 -         _2 = Eq(move _3, const 42_u32);  // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
17 -         StorageDead(_3);                 // scope 0 at $DIR/if_condition_int.rs:+1:14: +1:15
18 -         switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
19 +         nop;                             // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
20 +         nop;                             // scope 0 at $DIR/if_condition_int.rs:+1:14: +1:15
21 +         switchInt(move _3) -> [42: bb1, otherwise: bb2]; // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
22       }
23   
24       bb1: {
25 +         StorageDead(_3);                 // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
26           _0 = const 0_u32;                // scope 0 at $DIR/if_condition_int.rs:+2:9: +2:10
27           goto -> bb6;                     // scope 0 at $DIR/if_condition_int.rs:+1:5: +7:6
28       }
29   
30       bb2: {
31 +         StorageDead(_3);                 // scope 0 at $DIR/if_condition_int.rs:+1:8: +1:15
32           StorageLive(_4);                 // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:22
33           StorageLive(_5);                 // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:16
34           _5 = _1;                         // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:16
35 -         _4 = Ne(move _5, const 21_u32);  // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:22
36 -         StorageDead(_5);                 // scope 0 at $DIR/if_condition_int.rs:+3:21: +3:22
37 -         switchInt(move _4) -> [0: bb4, otherwise: bb3]; // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:22
38 +         nop;                             // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:22
39 +         nop;                             // scope 0 at $DIR/if_condition_int.rs:+3:21: +3:22
40 +         switchInt(move _5) -> [21: bb4, otherwise: bb3]; // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:22
41       }
42   
43       bb3: {
44 +         StorageDead(_5);                 // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:22
45           _0 = const 1_u32;                // scope 0 at $DIR/if_condition_int.rs:+4:9: +4:10
46           goto -> bb5;                     // scope 0 at $DIR/if_condition_int.rs:+3:12: +7:6
47       }
48   
49       bb4: {
50 +         StorageDead(_5);                 // scope 0 at $DIR/if_condition_int.rs:+3:15: +3:22
51           _0 = const 2_u32;                // scope 0 at $DIR/if_condition_int.rs:+6:9: +6:10
52           goto -> bb5;                     // scope 0 at $DIR/if_condition_int.rs:+3:12: +7:6
53       }
54   
55       bb5: {
56           StorageDead(_4);                 // scope 0 at $DIR/if_condition_int.rs:+7:5: +7:6
57           goto -> bb6;                     // scope 0 at $DIR/if_condition_int.rs:+1:5: +7:6
58       }
59   
60       bb6: {
61           StorageDead(_2);                 // scope 0 at $DIR/if_condition_int.rs:+7:5: +7:6
62           return;                          // scope 0 at $DIR/if_condition_int.rs:+8:2: +8:2
63       }
64   }
65