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