]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff
fd4dcb2265e61df2a0530bb17aca2151e9b61cf8
[rust.git] / src / test / mir-opt / if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff
1 - // MIR for `dont_remove_comparison` before SimplifyComparisonIntegral
2 + // MIR for `dont_remove_comparison` after SimplifyComparisonIntegral
3   
4   fn dont_remove_comparison(_1: i8) -> i32 {
5       debug a => _1;                       // in scope 0 at $DIR/if-condition-int.rs:43:27: 43:28
6       let mut _0: i32;                     // return place in scope 0 at $DIR/if-condition-int.rs:43:37: 43:40
7       let _2: bool;                        // in scope 0 at $DIR/if-condition-int.rs:44:9: 44:10
8       let mut _3: i8;                      // in scope 0 at $DIR/if-condition-int.rs:44:13: 44:14
9       let mut _4: i32;                     // in scope 0 at $DIR/if-condition-int.rs:46:23: 46:31
10       let mut _5: bool;                    // in scope 0 at $DIR/if-condition-int.rs:46:23: 46:24
11       let mut _6: i32;                     // in scope 0 at $DIR/if-condition-int.rs:47:23: 47:31
12       let mut _7: bool;                    // in scope 0 at $DIR/if-condition-int.rs:47:23: 47:24
13       scope 1 {
14           debug b => _2;                   // in scope 1 at $DIR/if-condition-int.rs:44:9: 44:10
15       }
16   
17       bb0: {
18           StorageLive(_2);                 // scope 0 at $DIR/if-condition-int.rs:44:9: 44:10
19           StorageLive(_3);                 // scope 0 at $DIR/if-condition-int.rs:44:13: 44:14
20           _3 = _1;                         // scope 0 at $DIR/if-condition-int.rs:44:13: 44:14
21 -         _2 = Eq(move _3, const 17_i8);   // scope 0 at $DIR/if-condition-int.rs:44:13: 44:20
22 -         StorageDead(_3);                 // scope 0 at $DIR/if-condition-int.rs:44:19: 44:20
23 -         switchInt(_2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/if-condition-int.rs:45:5: 45:12
24 +         _2 = Eq(_3, const 17_i8);        // scope 0 at $DIR/if-condition-int.rs:44:13: 44:20
25 +         nop;                             // scope 0 at $DIR/if-condition-int.rs:44:19: 44:20
26 +         switchInt(move _3) -> [17_i8: bb1, otherwise: bb2]; // scope 1 at $DIR/if-condition-int.rs:45:5: 45:12
27       }
28   
29       bb1: {
30 +         StorageDead(_3);                 // scope 1 at $DIR/if-condition-int.rs:45:5: 45:12
31           StorageLive(_6);                 // scope 1 at $DIR/if-condition-int.rs:47:23: 47:31
32           StorageLive(_7);                 // scope 1 at $DIR/if-condition-int.rs:47:23: 47:24
33           _7 = _2;                         // scope 1 at $DIR/if-condition-int.rs:47:23: 47:24
34           _6 = move _7 as i32 (Misc);      // scope 1 at $DIR/if-condition-int.rs:47:23: 47:31
35           StorageDead(_7);                 // scope 1 at $DIR/if-condition-int.rs:47:30: 47:31
36           _0 = Add(const 100_i32, move _6); // scope 1 at $DIR/if-condition-int.rs:47:17: 47:31
37           StorageDead(_6);                 // scope 1 at $DIR/if-condition-int.rs:47:30: 47:31
38           goto -> bb3;                     // scope 1 at $DIR/if-condition-int.rs:47:30: 47:31
39       }
40   
41       bb2: {
42 +         StorageDead(_3);                 // scope 1 at $DIR/if-condition-int.rs:45:5: 45:12
43           StorageLive(_4);                 // scope 1 at $DIR/if-condition-int.rs:46:23: 46:31
44           StorageLive(_5);                 // scope 1 at $DIR/if-condition-int.rs:46:23: 46:24
45           _5 = _2;                         // scope 1 at $DIR/if-condition-int.rs:46:23: 46:24
46           _4 = move _5 as i32 (Misc);      // scope 1 at $DIR/if-condition-int.rs:46:23: 46:31
47           StorageDead(_5);                 // scope 1 at $DIR/if-condition-int.rs:46:30: 46:31
48           _0 = Add(const 10_i32, move _4); // scope 1 at $DIR/if-condition-int.rs:46:18: 46:31
49           StorageDead(_4);                 // scope 1 at $DIR/if-condition-int.rs:46:30: 46:31
50           goto -> bb3;                     // scope 1 at $DIR/if-condition-int.rs:46:30: 46:31
51       }
52   
53       bb3: {
54           StorageDead(_2);                 // scope 0 at $DIR/if-condition-int.rs:49:1: 49:2
55           return;                          // scope 0 at $DIR/if-condition-int.rs:49:2: 49:2
56       }
57   }
58