fork/rust

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

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

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