fork/rust

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

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

master
2.5 KiB82 linesraw
1- // MIR for `inner` before ConstProp
2+ // MIR for `inner` after ConstProp
3  
4  fn inner(_1: u32) -> i64 {
5      debug fields => _1;
6      let mut _0: i64;
7      let mut _2: i32;
8      let mut _3: u32;
9      let mut _4: u32;
10      let mut _5: u32;
11      let mut _6: u32;
12      let mut _7: u32;
13      let mut _8: u32;
14      let mut _9: u32;
15      let mut _10: u32;
16      let mut _11: bool;
17      let mut _12: u32;
18      let mut _13: bool;
19      scope 1 (inlined imm8) {
20          debug x => _1;
21          let mut _14: u32;
22          let mut _15: u32;
23          scope 2 {
24              debug out => _4;
25          }
26      }
27      scope 3 (inlined core::num::<impl u32>::rotate_right) {
28          debug self => _4;
29          debug n => _6;
30      }
31  
32      bb0: {
33          StorageLive(_2);
34          StorageLive(_3);
35          StorageLive(_4);
36          StorageLive(_15);
37          StorageLive(_14);
38          _14 = Shr(_1, const 0_i32);
39          _15 = BitAnd(move _14, const 255_u32);
40          StorageDead(_14);
41          _4 = BitOr(const 0_u32, move _15);
42          StorageDead(_15);
43          StorageLive(_6);
44          StorageLive(_7);
45          StorageLive(_8);
46-         _10 = const 8_i32 as u32 (IntToInt);
47-         _11 = Lt(move _10, const 32_u32);
48-         assert(move _11, "attempt to shift right by `{}`, which would overflow", const 8_i32) -> [success: bb1, unwind continue];
49+         _10 = const 8_u32;
50+         _11 = const true;
51+         assert(const true, "attempt to shift right by `{}`, which would overflow", const 8_i32) -> [success: bb1, unwind continue];
52      }
53  
54      bb1: {
55          _8 = Shr(_1, const 8_i32);
56          _7 = BitAnd(move _8, const 15_u32);
57          StorageDead(_8);
58-         _12 = const 1_i32 as u32 (IntToInt);
59-         _13 = Lt(move _12, const 32_u32);
60-         assert(move _13, "attempt to shift left by `{}`, which would overflow", const 1_i32) -> [success: bb2, unwind continue];
61+         _12 = const 1_u32;
62+         _13 = const true;
63+         assert(const true, "attempt to shift left by `{}`, which would overflow", const 1_i32) -> [success: bb2, unwind continue];
64      }
65  
66      bb2: {
67          _6 = Shl(move _7, const 1_i32);
68          StorageDead(_7);
69          _3 = rotate_right::<u32>(move _4, move _6) -> [return: bb3, unwind unreachable];
70      }
71  
72      bb3: {
73          StorageDead(_6);
74          StorageDead(_4);
75          _2 = move _3 as i32 (IntToInt);
76          StorageDead(_3);
77          _0 = move _2 as i64 (IntToInt);
78          StorageDead(_2);
79          return;
80      }
81  }
82