summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/jump_threading.identity.JumpThreading.panic-abort.diff
blob: f50603a66a56f73bc5ee7d0483a230a81436e5ba (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
- // MIR for `identity` before JumpThreading
+ // MIR for `identity` after JumpThreading
  
  fn identity(_1: Result<i32, i32>) -> Result<i32, i32> {
      debug x => _1;
      let mut _0: std::result::Result<i32, i32>;
      let mut _2: i32;
      let mut _3: std::ops::ControlFlow<std::result::Result<std::convert::Infallible, i32>, i32>;
      let mut _4: std::result::Result<i32, i32>;
      let mut _5: isize;
      let _6: std::result::Result<std::convert::Infallible, i32>;
      let mut _7: !;
      let mut _8: std::result::Result<std::convert::Infallible, i32>;
      let _9: i32;
      scope 1 {
          debug residual => _6;
          scope 2 {
              scope 8 (inlined #[track_caller] <Result<i32, i32> as FromResidual<Result<Infallible, i32>>>::from_residual) {
                  debug residual => _8;
                  let _14: i32;
                  let mut _15: i32;
                  scope 9 {
                      debug e => _14;
                      scope 10 (inlined <i32 as From<i32>>::from) {
                          debug t => _14;
                      }
                  }
              }
          }
      }
      scope 3 {
          debug val => _9;
          scope 4 {
          }
      }
      scope 5 (inlined <Result<i32, i32> as Try>::branch) {
          debug self => _4;
          let mut _10: isize;
          let _11: i32;
          let _12: i32;
          let mut _13: std::result::Result<std::convert::Infallible, i32>;
          scope 6 {
              debug v => _11;
          }
          scope 7 {
              debug e => _12;
          }
      }
  
      bb0: {
          StorageLive(_2);
          StorageLive(_3);
          StorageLive(_4);
          _4 = _1;
          StorageLive(_10);
          StorageLive(_11);
          StorageLive(_12);
          _10 = discriminant(_4);
          switchInt(move _10) -> [0: bb8, 1: bb6, otherwise: bb7];
      }
  
      bb1: {
          StorageLive(_9);
          _9 = ((_3 as Continue).0: i32);
          _2 = _9;
          StorageDead(_9);
          _0 = Result::<i32, i32>::Ok(move _2);
          StorageDead(_2);
          StorageDead(_3);
          goto -> bb4;
      }
  
      bb2: {
          unreachable;
      }
  
      bb3: {
          StorageLive(_6);
          _6 = ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>);
          StorageLive(_8);
          _8 = _6;
          StorageLive(_14);
          _14 = move ((_8 as Err).0: i32);
          StorageLive(_15);
          _15 = move _14;
          _0 = Result::<i32, i32>::Err(move _15);
          StorageDead(_15);
          StorageDead(_14);
          StorageDead(_8);
          StorageDead(_6);
          StorageDead(_2);
          StorageDead(_3);
          goto -> bb4;
      }
  
      bb4: {
          return;
      }
  
      bb5: {
          StorageDead(_12);
          StorageDead(_11);
          StorageDead(_10);
          StorageDead(_4);
          _5 = discriminant(_3);
-         switchInt(move _5) -> [0: bb1, 1: bb3, otherwise: bb2];
+         goto -> bb1;
      }
  
      bb6: {
          _12 = move ((_4 as Err).0: i32);
          StorageLive(_13);
          _13 = Result::<Infallible, i32>::Err(move _12);
          _3 = ControlFlow::<Result<Infallible, i32>, i32>::Break(move _13);
          StorageDead(_13);
-         goto -> bb5;
+         goto -> bb9;
      }
  
      bb7: {
          unreachable;
      }
  
      bb8: {
          _11 = move ((_4 as Ok).0: i32);
          _3 = ControlFlow::<Result<Infallible, i32>, i32>::Continue(move _11);
          goto -> bb5;
+     }
+ 
+     bb9: {
+         StorageDead(_12);
+         StorageDead(_11);
+         StorageDead(_10);
+         StorageDead(_4);
+         _5 = discriminant(_3);
+         goto -> bb3;
      }
  }