summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff
blob: f1d18b0f7ff9cec1e4eea76c3d3a159133b0637c (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
- // MIR for `foo` before MatchBranchSimplification
+ // MIR for `foo` after MatchBranchSimplification
  
  fn foo(_1: [u8; 16]) -> Option<[u8; 4]> {
      debug bytes => _1;
      let mut _0: std::option::Option<[u8; 4]>;
      let _2: [u32; 4];
      let mut _3: [u8; 16];
      let mut _5: [u8; 4];
      let mut _6: u32;
      scope 1 {
          debug dwords => _2;
          scope 3 {
              debug ip => _4;
              let _4: u32;
              scope 4 {
              }
          }
      }
      scope 2 {
      }
  
      bb0: {
          StorageLive(_2);
          StorageLive(_3);
          _3 = _1;
          _2 = move _3 as [u32; 4] (Transmute);
          StorageDead(_3);
          switchInt(_2[0 of 4]) -> [0: bb1, otherwise: bb6];
      }
  
      bb1: {
          switchInt(_2[1 of 4]) -> [0: bb2, otherwise: bb6];
      }
  
      bb2: {
          switchInt(_2[2 of 4]) -> [0: bb4, 4294901760: bb5, otherwise: bb6];
      }
  
      bb3: {
          StorageLive(_5);
          StorageLive(_6);
          _6 = _4;
          _5 = move _6 as [u8; 4] (Transmute);
          StorageDead(_6);
          _0 = Option::<[u8; 4]>::Some(move _5);
          StorageDead(_5);
          StorageDead(_4);
          goto -> bb7;
      }
  
      bb4: {
          StorageLive(_4);
          _4 = _2[3 of 4];
          goto -> bb3;
      }
  
      bb5: {
          StorageLive(_4);
          _4 = _2[3 of 4];
          goto -> bb3;
      }
  
      bb6: {
          _0 = Option::<[u8; 4]>::None;
          goto -> bb7;
      }
  
      bb7: {
          StorageDead(_2);
          return;
      }
  }