about summary refs log tree commit diff
path: root/tests/mir-opt/const_prop/while_let_loops.change_loop_body.GVN.diff
blob: f830624cae76ed1cb0e97d4835f529ecf521c60f (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
- // MIR for `change_loop_body` before GVN
+ // MIR for `change_loop_body` after GVN
  
  fn change_loop_body() -> () {
      let mut _0: ();
      let mut _1: i32;
      let mut _2: ();
      let mut _3: std::option::Option<u32>;
      let mut _4: isize;
      let mut _5: !;
      let mut _6: !;
      let _7: ();
      let mut _8: !;
      scope 1 {
          debug _x => _1;
          scope 2 {
          }
      }
  
      bb0: {
          StorageLive(_1);
          _1 = const 0_i32;
          StorageLive(_3);
-         _3 = Option::<u32>::None;
-         _4 = discriminant(_3);
-         switchInt(move _4) -> [1: bb1, otherwise: bb3];
+         _3 = const Option::<u32>::None;
+         _4 = const 0_isize;
+         switchInt(const 0_isize) -> [1: bb1, otherwise: bb3];
      }
  
      bb1: {
-         switchInt(copy ((_3 as Some).0: u32)) -> [0: bb2, otherwise: bb3];
+         switchInt(const Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: u32) -> [0: bb2, otherwise: bb3];
      }
  
      bb2: {
          _1 = const 1_i32;
          _0 = const ();
          goto -> bb4;
      }
  
      bb3: {
          StorageLive(_7);
          _0 = const ();
          StorageDead(_7);
          goto -> bb4;
      }
  
      bb4: {
          StorageDead(_3);
          StorageDead(_1);
          return;
      }
+ }
+ 
+ ALLOC0 (size: 8, align: 4) {
+     00 00 00 00 __ __ __ __                         │ ....░░░░
  }