fork/rust

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

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

master
1.9 KiB84 linesraw
1- // MIR for `bar` before MatchBranchSimplification
2+ // MIR for `bar` after MatchBranchSimplification
3  
4  fn bar(_1: i32) -> (bool, bool, bool, bool) {
5      debug i => _1;
6      let mut _0: (bool, bool, bool, bool);
7      let _2: bool;
8      let _6: ();
9      let mut _7: bool;
10      let mut _8: bool;
11      let mut _9: bool;
12      let mut _10: bool;
13+     let mut _11: i32;
14      scope 1 {
15          debug a => _2;
16          let _3: bool;
17          scope 2 {
18              debug b => _3;
19              let _4: bool;
20              scope 3 {
21                  debug c => _4;
22                  let _5: bool;
23                  scope 4 {
24                      debug d => _5;
25                  }
26              }
27          }
28      }
29  
30      bb0: {
31          StorageLive(_2);
32          StorageLive(_3);
33          StorageLive(_4);
34          StorageLive(_5);
35          StorageLive(_6);
36-         switchInt(_1) -> [7: bb2, otherwise: bb1];
37-     }
38- 
39-     bb1: {
40-         _2 = const true;
41-         _3 = const false;
42+         StorageLive(_11);
43+         _11 = _1;
44+         _2 = Ne(_11, const 7_i32);
45+         _3 = Eq(_11, const 7_i32);
46          _4 = const false;
47          _5 = const true;
48          _6 = ();
49-         goto -> bb3;
50-     }
51- 
52-     bb2: {
53-         _2 = const false;
54-         _3 = const true;
55-         _4 = const false;
56-         _5 = const true;
57-         _6 = ();
58-         goto -> bb3;
59-     }
60- 
61-     bb3: {
62+         StorageDead(_11);
63          StorageDead(_6);
64          StorageLive(_7);
65          _7 = _2;
66          StorageLive(_8);
67          _8 = _3;
68          StorageLive(_9);
69          _9 = _4;
70          StorageLive(_10);
71          _10 = _5;
72          _0 = (move _7, move _8, move _9, move _10);
73          StorageDead(_10);
74          StorageDead(_9);
75          StorageDead(_8);
76          StorageDead(_7);
77          StorageDead(_5);
78          StorageDead(_4);
79          StorageDead(_3);
80          StorageDead(_2);
81          return;
82      }
83  }
84