]> git.proxmox.com Git - rustc.git/blame - tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.mir
New upstream version 1.71.1+dfsg1
[rustc.git] / tests / mir-opt / inline / unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.mir
CommitLineData
353b0b11
FG
1// MIR for `unchecked_shl_unsigned_smaller` after PreCodegen
2
3fn unchecked_shl_unsigned_smaller(_1: u16, _2: u32) -> u16 {
4 debug a => _1; // in scope 0 at $DIR/unchecked_shifts.rs:+0:46: +0:47
5 debug b => _2; // in scope 0 at $DIR/unchecked_shifts.rs:+0:54: +0:55
6 let mut _0: u16; // return place in scope 0 at $DIR/unchecked_shifts.rs:+0:65: +0:68
7 scope 1 (inlined core::num::<impl u16>::unchecked_shl) { // at $DIR/unchecked_shifts.rs:11:7: 11:23
8 debug self => _1; // in scope 1 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
9 debug rhs => _2; // in scope 1 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
49aad941
FG
10 let mut _3: u16; // in scope 1 at $SRC_DIR/core/src/num/mod.rs:LL:COL
11 let mut _4: (u32,); // in scope 1 at $SRC_DIR/core/src/num/mod.rs:LL:COL
12 let mut _5: u32; // in scope 1 at $SRC_DIR/core/src/num/mod.rs:LL:COL
353b0b11 13 scope 2 {
49aad941
FG
14 scope 3 (inlined core::num::<impl u16>::unchecked_shl::conv) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
15 debug x => _5; // in scope 3 at $SRC_DIR/core/src/num/mod.rs:LL:COL
16 let mut _6: std::option::Option<u16>; // in scope 3 at $SRC_DIR/core/src/num/mod.rs:LL:COL
17 let mut _7: std::result::Result<u16, std::num::TryFromIntError>; // in scope 3 at $SRC_DIR/core/src/num/mod.rs:LL:COL
18 scope 4 {
19 scope 5 (inlined <u32 as TryInto<u16>>::try_into) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
20 debug self => _5; // in scope 5 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
21 scope 6 (inlined convert::num::<impl TryFrom<u32> for u16>::try_from) { // at $SRC_DIR/core/src/convert/mod.rs:LL:COL
22 debug u => _5; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
23 let mut _8: bool; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
24 let mut _9: u32; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
25 let mut _10: u16; // in scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
26 }
353b0b11 27 }
49aad941
FG
28 scope 7 (inlined Result::<u16, TryFromIntError>::ok) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
29 debug self => _7; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
30 let mut _11: isize; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
31 let _12: u16; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
32 scope 8 {
33 debug x => _12; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
34 }
35 }
36 scope 9 (inlined #[track_caller] Option::<u16>::unwrap_unchecked) { // at $SRC_DIR/core/src/num/mod.rs:LL:COL
37 debug self => _6; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
38 let mut _13: &std::option::Option<u16>; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
39 let mut _14: isize; // in scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
40 scope 10 {
41 debug val => _3; // in scope 10 at $SRC_DIR/core/src/option.rs:LL:COL
42 }
43 scope 11 {
44 scope 13 (inlined unreachable_unchecked) { // at $SRC_DIR/core/src/option.rs:LL:COL
45 scope 14 {
46 scope 15 (inlined unreachable_unchecked::runtime) { // at $SRC_DIR/core/src/intrinsics.rs:LL:COL
47 }
48 }
353b0b11
FG
49 }
50 }
49aad941
FG
51 scope 12 (inlined Option::<u16>::is_some) { // at $SRC_DIR/core/src/option.rs:LL:COL
52 debug self => _13; // in scope 12 at $SRC_DIR/core/src/option.rs:LL:COL
53 }
353b0b11
FG
54 }
55 }
353b0b11
FG
56 }
57 }
58 }
59
60 bb0: {
49aad941
FG
61 StorageLive(_3); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
62 StorageLive(_4); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
63 _4 = (_2,); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
64 StorageLive(_5); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
65 _5 = move (_4.0: u32); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
66 StorageLive(_6); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
67 StorageLive(_7); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
68 StorageLive(_8); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
69 StorageLive(_9); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
70 _9 = const 65535_u32; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
71 _8 = Gt(_5, move _9); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
72 StorageDead(_9); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
73 switchInt(move _8) -> [0: bb3, otherwise: bb2]; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
353b0b11
FG
74 }
75
76 bb1: {
353b0b11
FG
77 StorageDead(_3); // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
78 return; // scope 0 at $DIR/unchecked_shifts.rs:+2:2: +2:2
79 }
80
49aad941
FG
81 bb2: {
82 _7 = Result::<u16, TryFromIntError>::Err(const TryFromIntError(())); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
353b0b11
FG
83 // mir::Constant
84 // + span: no-location
85 // + literal: Const { ty: TryFromIntError, val: Value(<ZST>) }
49aad941
FG
86 goto -> bb4; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
87 }
88
89 bb3: {
90 StorageLive(_10); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
91 _10 = _5 as u16 (IntToInt); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
92 _7 = Result::<u16, TryFromIntError>::Ok(move _10); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
93 StorageDead(_10); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
94 goto -> bb4; // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
353b0b11
FG
95 }
96
97 bb4: {
49aad941
FG
98 StorageDead(_8); // scope 6 at $SRC_DIR/core/src/convert/num.rs:LL:COL
99 StorageLive(_12); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
100 _11 = discriminant(_7); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
101 switchInt(move _11) -> [0: bb7, 1: bb5, otherwise: bb6]; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
353b0b11
FG
102 }
103
104 bb5: {
49aad941
FG
105 _6 = Option::<u16>::None; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
106 goto -> bb8; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
353b0b11
FG
107 }
108
109 bb6: {
49aad941 110 unreachable; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
353b0b11
FG
111 }
112
113 bb7: {
49aad941
FG
114 _12 = move ((_7 as Ok).0: u16); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
115 _6 = Option::<u16>::Some(move _12); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
116 goto -> bb8; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
353b0b11
FG
117 }
118
119 bb8: {
49aad941
FG
120 StorageDead(_12); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
121 StorageDead(_7); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
122 StorageLive(_13); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
123 _14 = discriminant(_6); // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
124 switchInt(move _14) -> [1: bb9, otherwise: bb6]; // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
353b0b11
FG
125 }
126
127 bb9: {
49aad941
FG
128 _3 = move ((_6 as Some).0: u16); // scope 9 at $SRC_DIR/core/src/option.rs:LL:COL
129 StorageDead(_13); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
130 StorageDead(_6); // scope 4 at $SRC_DIR/core/src/num/mod.rs:LL:COL
131 StorageDead(_5); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
132 StorageDead(_4); // scope 2 at $SRC_DIR/core/src/num/mod.rs:LL:COL
133 _0 = unchecked_shl::<u16>(_1, move _3) -> [return: bb1, unwind unreachable]; // scope 2 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
353b0b11
FG
134 // mir::Constant
135 // + span: $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
136 // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(u16, u16) -> u16 {unchecked_shl::<u16>}, val: Value(<ZST>) }
137 }
138}