summary refs log tree commit diff
path: root/src/test/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff
blob: b590be5370f1d41050f9fa2d0e0689832aaf094d (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:43:27: 43:28
      let mut _0: i32;                     // return place in scope 0 at $DIR/if-condition-int.rs:43:37: 43:40
      let _2: bool;                        // in scope 0 at $DIR/if-condition-int.rs:44:9: 44:10
      let mut _3: i8;                      // in scope 0 at $DIR/if-condition-int.rs:44:13: 44:14
      let mut _4: i32;                     // in scope 0 at $DIR/if-condition-int.rs:46:23: 46:31
      let mut _5: bool;                    // in scope 0 at $DIR/if-condition-int.rs:46:23: 46:24
      let mut _6: i32;                     // in scope 0 at $DIR/if-condition-int.rs:47:23: 47:31
      let mut _7: bool;                    // in scope 0 at $DIR/if-condition-int.rs:47:23: 47:24
      scope 1 {
          debug b => _2;                   // in scope 1 at $DIR/if-condition-int.rs:44:9: 44:10
      }
  
      bb0: {
          StorageLive(_2);                 // scope 0 at $DIR/if-condition-int.rs:44:9: 44:10
          StorageLive(_3);                 // scope 0 at $DIR/if-condition-int.rs:44:13: 44:14
          _3 = _1;                         // scope 0 at $DIR/if-condition-int.rs:44:13: 44:14
-         _2 = Eq(move _3, const 17_i8);   // scope 0 at $DIR/if-condition-int.rs:44:13: 44:20
-         StorageDead(_3);                 // scope 0 at $DIR/if-condition-int.rs:44:19: 44:20
-         switchInt(_2) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/if-condition-int.rs:46:9: 46:14
+         _2 = Eq(_3, const 17_i8);        // scope 0 at $DIR/if-condition-int.rs:44:13: 44:20
+         nop;                             // scope 0 at $DIR/if-condition-int.rs:44:19: 44:20
+         switchInt(move _3) -> [17_i8: bb1, otherwise: bb2]; // scope 1 at $DIR/if-condition-int.rs:46:9: 46:14
      }
  
      bb1: {
+         StorageDead(_3);                 // scope 1 at $DIR/if-condition-int.rs:46:9: 46:14
          StorageLive(_6);                 // scope 1 at $DIR/if-condition-int.rs:47:23: 47:31
          StorageLive(_7);                 // scope 1 at $DIR/if-condition-int.rs:47:23: 47:24
          _7 = _2;                         // scope 1 at $DIR/if-condition-int.rs:47:23: 47:24
          _6 = move _7 as i32 (Misc);      // scope 1 at $DIR/if-condition-int.rs:47:23: 47:31
          StorageDead(_7);                 // scope 1 at $DIR/if-condition-int.rs:47:30: 47:31
          _0 = Add(const 100_i32, move _6); // scope 1 at $DIR/if-condition-int.rs:47:17: 47:31
          StorageDead(_6);                 // scope 1 at $DIR/if-condition-int.rs:47:30: 47:31
          goto -> bb3;                     // scope 1 at $DIR/if-condition-int.rs:45:5: 48:6
      }
  
      bb2: {
+         StorageDead(_3);                 // scope 1 at $DIR/if-condition-int.rs:46:9: 46:14
          StorageLive(_4);                 // scope 1 at $DIR/if-condition-int.rs:46:23: 46:31
          StorageLive(_5);                 // scope 1 at $DIR/if-condition-int.rs:46:23: 46:24
          _5 = _2;                         // scope 1 at $DIR/if-condition-int.rs:46:23: 46:24
          _4 = move _5 as i32 (Misc);      // scope 1 at $DIR/if-condition-int.rs:46:23: 46:31
          StorageDead(_5);                 // scope 1 at $DIR/if-condition-int.rs:46:30: 46:31
          _0 = Add(const 10_i32, move _4); // scope 1 at $DIR/if-condition-int.rs:46:18: 46:31
          StorageDead(_4);                 // scope 1 at $DIR/if-condition-int.rs:46:30: 46:31
          goto -> bb3;                     // scope 1 at $DIR/if-condition-int.rs:45:5: 48:6
      }
  
      bb3: {
          StorageDead(_2);                 // scope 0 at $DIR/if-condition-int.rs:49:1: 49:2
          return;                          // scope 0 at $DIR/if-condition-int.rs:49:2: 49:2
      }
  }