fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
2.4 KiB115 linesraw
1- // MIR for `match_nested_if` before MatchBranchSimplification
2+ // MIR for `match_nested_if` after MatchBranchSimplification
3  
4  fn match_nested_if() -> bool {
5      let mut _0: bool;
6      let _1: bool;
7      let mut _2: ();
8      let mut _3: bool;
9      let mut _4: bool;
10      let mut _5: bool;
11      let mut _6: bool;
12+     let mut _7: bool;
13+     let mut _8: bool;
14+     let mut _9: bool;
15+     let mut _10: bool;
16      scope 1 {
17          debug val => _1;
18      }
19  
20      bb0: {
21          StorageLive(_1);
22          StorageLive(_2);
23          _2 = ();
24          StorageLive(_3);
25          StorageLive(_4);
26          StorageLive(_5);
27          StorageLive(_6);
28          _6 = const true;
29-         switchInt(move _6) -> [0: bb2, otherwise: bb1];
30-     }
31- 
32-     bb1: {
33-         _5 = const true;
34-         goto -> bb3;
35-     }
36- 
37-     bb2: {
38-         _5 = const false;
39-         goto -> bb3;
40-     }
41- 
42-     bb3: {
43-         switchInt(move _5) -> [0: bb5, otherwise: bb4];
44-     }
45- 
46-     bb4: {
47+         StorageLive(_7);
48+         _7 = move _6;
49+         _5 = Ne(_7, const false);
50+         StorageDead(_7);
51+         StorageLive(_8);
52+         _8 = move _5;
53          StorageDead(_6);
54-         _4 = const true;
55-         goto -> bb6;
56-     }
57- 
58-     bb5: {
59-         StorageDead(_6);
60-         _4 = const false;
61-         goto -> bb6;
62-     }
63- 
64-     bb6: {
65-         switchInt(move _4) -> [0: bb8, otherwise: bb7];
66-     }
67- 
68-     bb7: {
69+         _4 = Ne(_8, const false);
70+         StorageDead(_8);
71+         StorageLive(_9);
72+         _9 = move _4;
73          StorageDead(_5);
74-         _3 = const true;
75-         goto -> bb9;
76-     }
77- 
78-     bb8: {
79-         StorageDead(_5);
80-         _3 = const false;
81-         goto -> bb9;
82-     }
83- 
84-     bb9: {
85-         switchInt(move _3) -> [0: bb11, otherwise: bb10];
86-     }
87- 
88-     bb10: {
89+         _3 = Ne(_9, const false);
90+         StorageDead(_9);
91+         StorageLive(_10);
92+         _10 = move _3;
93          StorageDead(_4);
94          StorageDead(_3);
95-         _1 = const true;
96-         goto -> bb12;
97-     }
98- 
99-     bb11: {
100-         StorageDead(_4);
101-         StorageDead(_3);
102-         _1 = const false;
103-         goto -> bb12;
104-     }
105- 
106-     bb12: {
107+         _1 = Ne(_10, const false);
108+         StorageDead(_10);
109          StorageDead(_2);
110          _0 = _1;
111          StorageDead(_1);
112          return;
113      }
114  }
115