summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff
blob: b5edbfee0fc1e08a73e39e77d710270c62d24375 (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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
- // MIR for `match_nested_if` before MatchBranchSimplification
+ // MIR for `match_nested_if` after MatchBranchSimplification
  
  fn match_nested_if() -> bool {
      let mut _0: bool;
      let _1: bool;
      let mut _2: ();
      let mut _3: bool;
      let mut _4: bool;
      let mut _5: bool;
      let mut _6: bool;
+     let mut _7: bool;
+     let mut _8: bool;
+     let mut _9: bool;
+     let mut _10: bool;
      scope 1 {
          debug val => _1;
      }
  
      bb0: {
          StorageLive(_1);
          StorageLive(_2);
          _2 = ();
          StorageLive(_3);
          StorageLive(_4);
          StorageLive(_5);
          StorageLive(_6);
          _6 = const true;
-         switchInt(move _6) -> [0: bb2, otherwise: bb1];
-     }
- 
-     bb1: {
-         _5 = const true;
-         goto -> bb3;
-     }
- 
-     bb2: {
-         _5 = const false;
-         goto -> bb3;
-     }
- 
-     bb3: {
+         StorageLive(_7);
+         _7 = move _6;
+         _5 = Ne(_7, const false);
+         StorageDead(_7);
          StorageDead(_6);
-         switchInt(move _5) -> [0: bb5, otherwise: bb4];
-     }
- 
-     bb4: {
-         _4 = const true;
-         goto -> bb6;
-     }
- 
-     bb5: {
-         _4 = const false;
-         goto -> bb6;
-     }
- 
-     bb6: {
+         StorageLive(_8);
+         _8 = move _5;
+         _4 = Ne(_8, const false);
+         StorageDead(_8);
          StorageDead(_5);
-         switchInt(move _4) -> [0: bb8, otherwise: bb7];
-     }
- 
-     bb7: {
-         _3 = const true;
-         goto -> bb9;
-     }
- 
-     bb8: {
-         _3 = const false;
-         goto -> bb9;
-     }
- 
-     bb9: {
-         switchInt(move _3) -> [0: bb11, otherwise: bb10];
-     }
- 
-     bb10: {
+         StorageLive(_9);
+         _9 = move _4;
+         _3 = Ne(_9, const false);
+         StorageDead(_9);
+         StorageLive(_10);
+         _10 = move _3;
          StorageDead(_4);
          StorageDead(_3);
-         _1 = const true;
-         goto -> bb12;
-     }
- 
-     bb11: {
-         StorageDead(_4);
-         StorageDead(_3);
-         _1 = const false;
-         goto -> bb12;
-     }
- 
-     bb12: {
+         _1 = Ne(_10, const false);
+         StorageDead(_10);
          StorageDead(_2);
          _0 = _1;
          StorageDead(_1);
          return;
      }
  }