fork/rust

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

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

master
1.9 KiB76 linesraw
1- // MIR for `opt1` before EarlyOtherwiseBranch
2+ // MIR for `opt1` after EarlyOtherwiseBranch
3  
4  fn opt1(_1: Option<u32>, _2: Option<u32>) -> u32 {
5      debug x => _1;
6      debug y => _2;
7      let mut _0: u32;
8      let mut _3: (std::option::Option<u32>, std::option::Option<u32>);
9      let mut _4: std::option::Option<u32>;
10      let mut _5: std::option::Option<u32>;
11      let mut _6: isize;
12      let mut _7: isize;
13      let _8: u32;
14      let _9: u32;
15+     let mut _10: isize;
16+     let mut _11: bool;
17      scope 1 {
18          debug a => _8;
19          debug b => _9;
20      }
21  
22      bb0: {
23          StorageLive(_3);
24          StorageLive(_4);
25          _4 = _1;
26          StorageLive(_5);
27          _5 = _2;
28          _3 = (move _4, move _5);
29          StorageDead(_5);
30          StorageDead(_4);
31          _7 = discriminant((_3.0: std::option::Option<u32>));
32-         switchInt(move _7) -> [1: bb2, otherwise: bb1];
33+         StorageLive(_10);
34+         _10 = discriminant((_3.1: std::option::Option<u32>));
35+         StorageLive(_11);
36+         _11 = Ne(_7, move _10);
37+         StorageDead(_10);
38+         switchInt(move _11) -> [0: bb4, otherwise: bb1];
39      }
40  
41      bb1: {
42+         StorageDead(_11);
43          _0 = const 1_u32;
44-         goto -> bb4;
45+         goto -> bb3;
46      }
47  
48      bb2: {
49-         _6 = discriminant((_3.1: std::option::Option<u32>));
50-         switchInt(move _6) -> [1: bb3, otherwise: bb1];
51-     }
52- 
53-     bb3: {
54          StorageLive(_8);
55          _8 = (((_3.0: std::option::Option<u32>) as Some).0: u32);
56          StorageLive(_9);
57          _9 = (((_3.1: std::option::Option<u32>) as Some).0: u32);
58          _0 = const 0_u32;
59          StorageDead(_9);
60          StorageDead(_8);
61-         goto -> bb4;
62+         goto -> bb3;
63      }
64  
65-     bb4: {
66+     bb3: {
67          StorageDead(_3);
68          return;
69+     }
70+ 
71+     bb4: {
72+         StorageDead(_11);
73+         switchInt(_7) -> [1: bb2, otherwise: bb1];
74      }
75  }
76