summary refs log tree commit diff
path: root/src/test/mir-opt/dest-prop/branch.main.DestinationPropagation.diff
blob: c3aa19e6c5f8402fa0e7475fc6198ed6015a8c43 (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
59
60
61
62
63
64
65
- // MIR for `main` before DestinationPropagation
+ // MIR for `main` after DestinationPropagation
  
  fn main() -> () {
      let mut _0: ();                      // return place in scope 0 at $DIR/branch.rs:12:11: 12:11
      let _1: i32;                         // in scope 0 at $DIR/branch.rs:13:9: 13:10
      let mut _3: bool;                    // in scope 0 at $DIR/branch.rs:15:16: 15:22
      let _4: i32;                         // in scope 0 at $DIR/branch.rs:18:9: 18:14
      scope 1 {
          debug x => _1;                   // in scope 1 at $DIR/branch.rs:13:9: 13:10
          let _2: i32;                     // in scope 1 at $DIR/branch.rs:15:9: 15:10
          scope 2 {
              debug y => _2;               // in scope 2 at $DIR/branch.rs:15:9: 15:10
          }
      }
  
      bb0: {
          StorageLive(_1);                 // scope 0 at $DIR/branch.rs:13:9: 13:10
          _1 = val() -> bb1;               // scope 0 at $DIR/branch.rs:13:13: 13:18
                                           // mir::Constant
                                           // + span: $DIR/branch.rs:13:13: 13:16
                                           // + literal: Const { ty: fn() -> i32 {val}, val: Value(Scalar(<ZST>)) }
      }
  
      bb1: {
          StorageLive(_2);                 // scope 1 at $DIR/branch.rs:15:9: 15:10
          StorageLive(_3);                 // scope 1 at $DIR/branch.rs:15:16: 15:22
          _3 = cond() -> bb2;              // scope 1 at $DIR/branch.rs:15:16: 15:22
                                           // mir::Constant
                                           // + span: $DIR/branch.rs:15:16: 15:20
                                           // + literal: Const { ty: fn() -> bool {cond}, val: Value(Scalar(<ZST>)) }
      }
  
      bb2: {
          switchInt(move _3) -> [false: bb4, otherwise: bb3]; // scope 1 at $DIR/branch.rs:15:16: 15:22
      }
  
      bb3: {
          nop;                             // scope 1 at $DIR/branch.rs:16:9: 16:10
          goto -> bb6;                     // scope 1 at $DIR/branch.rs:15:13: 20:6
      }
  
      bb4: {
          StorageLive(_4);                 // scope 1 at $DIR/branch.rs:18:9: 18:14
          _4 = val() -> bb5;               // scope 1 at $DIR/branch.rs:18:9: 18:14
                                           // mir::Constant
                                           // + span: $DIR/branch.rs:18:9: 18:12
                                           // + literal: Const { ty: fn() -> i32 {val}, val: Value(Scalar(<ZST>)) }
      }
  
      bb5: {
          StorageDead(_4);                 // scope 1 at $DIR/branch.rs:18:14: 18:15
          nop;                             // scope 1 at $DIR/branch.rs:19:9: 19:10
          goto -> bb6;                     // scope 1 at $DIR/branch.rs:15:13: 20:6
      }
  
      bb6: {
          StorageDead(_3);                 // scope 1 at $DIR/branch.rs:20:5: 20:6
          nop;                             // scope 0 at $DIR/branch.rs:12:11: 21:2
          StorageDead(_2);                 // scope 1 at $DIR/branch.rs:21:1: 21:2
          StorageDead(_1);                 // scope 0 at $DIR/branch.rs:21:1: 21:2
          return;                          // scope 0 at $DIR/branch.rs:21:2: 21:2
      }
  }