summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff
blob: f98d68e6ffce3b9ea0b68e1b76b1b6977a7f1870 (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
- // MIR for `opt1` before EarlyOtherwiseBranch
+ // MIR for `opt1` after EarlyOtherwiseBranch
  
  fn opt1(_1: Option<u32>, _2: Option<u32>, _3: Option<u32>) -> u32 {
      debug x => _1;
      debug y => _2;
      debug z => _3;
      let mut _0: u32;
      let mut _4: (std::option::Option<u32>, std::option::Option<u32>, std::option::Option<u32>);
      let mut _5: std::option::Option<u32>;
      let mut _6: std::option::Option<u32>;
      let mut _7: std::option::Option<u32>;
      let mut _8: isize;
      let mut _9: isize;
      let mut _10: isize;
      let _11: u32;
      let _12: u32;
      let _13: u32;
+     let mut _14: isize;
+     let mut _15: bool;
+     let mut _16: isize;
+     let mut _17: bool;
      scope 1 {
          debug a => _11;
          debug b => _12;
          debug c => _13;
      }
  
      bb0: {
          StorageLive(_4);
          StorageLive(_5);
          _5 = _1;
          StorageLive(_6);
          _6 = _2;
          StorageLive(_7);
          _7 = _3;
          _4 = (move _5, move _6, move _7);
          StorageDead(_7);
          StorageDead(_6);
          StorageDead(_5);
          _10 = discriminant((_4.0: std::option::Option<u32>));
-         switchInt(move _10) -> [1: bb2, otherwise: bb1];
+         StorageLive(_14);
+         _14 = discriminant((_4.1: std::option::Option<u32>));
+         StorageLive(_15);
+         _15 = Ne(_10, move _14);
+         StorageDead(_14);
+         switchInt(move _15) -> [0: bb5, otherwise: bb1];
      }
  
      bb1: {
+         StorageDead(_17);
+         StorageDead(_15);
          _0 = const 1_u32;
-         goto -> bb5;
+         goto -> bb4;
      }
  
      bb2: {
-         _9 = discriminant((_4.1: std::option::Option<u32>));
-         switchInt(move _9) -> [1: bb3, otherwise: bb1];
-     }
- 
-     bb3: {
          _8 = discriminant((_4.2: std::option::Option<u32>));
-         switchInt(move _8) -> [1: bb4, otherwise: bb1];
+         switchInt(move _8) -> [1: bb3, otherwise: bb1];
      }
  
-     bb4: {
+     bb3: {
          StorageLive(_11);
          _11 = (((_4.0: std::option::Option<u32>) as Some).0: u32);
          StorageLive(_12);
          _12 = (((_4.1: std::option::Option<u32>) as Some).0: u32);
          StorageLive(_13);
          _13 = (((_4.2: std::option::Option<u32>) as Some).0: u32);
          _0 = const 0_u32;
          StorageDead(_13);
          StorageDead(_12);
          StorageDead(_11);
-         goto -> bb5;
+         goto -> bb4;
      }
  
-     bb5: {
+     bb4: {
          StorageDead(_4);
          return;
+     }
+ 
+     bb5: {
+         StorageDead(_15);
+         switchInt(_10) -> [1: bb2, otherwise: bb1];
      }
  }