]> git.proxmox.com Git - rustc.git/blob - src/test/mir-opt/separate_const_switch.identity.PreCodegen.after.mir
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / src / test / mir-opt / separate_const_switch.identity.PreCodegen.after.mir
1 // MIR for `identity` after PreCodegen
2
3 fn identity(_1: Result<i32, i32>) -> Result<i32, i32> {
4 debug x => _1; // in scope 0 at $DIR/separate_const_switch.rs:28:13: 28:14
5 let mut _0: std::result::Result<i32, i32>; // return place in scope 0 at $DIR/separate_const_switch.rs:28:37: 28:53
6 let mut _2: i32; // in scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
7 let mut _3: std::ops::ControlFlow<std::result::Result<std::convert::Infallible, i32>, i32>; // in scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
8 let mut _4: std::result::Result<i32, i32>; // in scope 0 at $DIR/separate_const_switch.rs:29:8: 29:9
9 let _5: std::result::Result<std::convert::Infallible, i32>; // in scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10
10 let mut _6: std::result::Result<std::convert::Infallible, i32>; // in scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10
11 let _7: i32; // in scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
12 scope 1 {
13 debug residual => _5; // in scope 1 at $DIR/separate_const_switch.rs:29:9: 29:10
14 scope 2 {
15 scope 8 (inlined <Result<i32, i32> as FromResidual<Result<Infallible, i32>>>::from_residual) { // at $DIR/separate_const_switch.rs:29:8: 29:10
16 debug residual => _6; // in scope 8 at $DIR/separate_const_switch.rs:29:8: 29:10
17 let _14: i32; // in scope 8 at $DIR/separate_const_switch.rs:29:8: 29:10
18 let mut _15: i32; // in scope 8 at $DIR/separate_const_switch.rs:29:8: 29:10
19 let mut _16: i32; // in scope 8 at $DIR/separate_const_switch.rs:29:8: 29:10
20 scope 9 {
21 debug e => _14; // in scope 9 at $DIR/separate_const_switch.rs:29:8: 29:10
22 scope 10 (inlined <i32 as From<i32>>::from) { // at $DIR/separate_const_switch.rs:29:8: 29:10
23 debug t => _16; // in scope 10 at $DIR/separate_const_switch.rs:29:8: 29:10
24 }
25 }
26 }
27 }
28 }
29 scope 3 {
30 debug val => _7; // in scope 3 at $DIR/separate_const_switch.rs:29:8: 29:10
31 scope 4 {
32 }
33 }
34 scope 5 (inlined <Result<i32, i32> as Try>::branch) { // at $DIR/separate_const_switch.rs:29:8: 29:10
35 debug self => _4; // in scope 5 at $DIR/separate_const_switch.rs:29:8: 29:10
36 let mut _8: isize; // in scope 5 at $DIR/separate_const_switch.rs:29:8: 29:10
37 let _9: i32; // in scope 5 at $DIR/separate_const_switch.rs:29:8: 29:10
38 let mut _10: i32; // in scope 5 at $DIR/separate_const_switch.rs:29:8: 29:10
39 let _11: i32; // in scope 5 at $DIR/separate_const_switch.rs:29:8: 29:10
40 let mut _12: std::result::Result<std::convert::Infallible, i32>; // in scope 5 at $DIR/separate_const_switch.rs:29:8: 29:10
41 let mut _13: i32; // in scope 5 at $DIR/separate_const_switch.rs:29:8: 29:10
42 scope 6 {
43 debug v => _9; // in scope 6 at $DIR/separate_const_switch.rs:29:8: 29:10
44 }
45 scope 7 {
46 debug e => _11; // in scope 7 at $DIR/separate_const_switch.rs:29:8: 29:10
47 }
48 }
49
50 bb0: {
51 StorageLive(_2); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
52 StorageLive(_3); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
53 StorageLive(_4); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:9
54 _4 = _1; // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:9
55 StorageLive(_8); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
56 _8 = discriminant(_4); // scope 5 at $DIR/separate_const_switch.rs:29:8: 29:10
57 switchInt(move _8) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 5 at $DIR/separate_const_switch.rs:29:8: 29:10
58 }
59
60 bb1: {
61 StorageLive(_11); // scope 5 at $DIR/separate_const_switch.rs:29:8: 29:10
62 _11 = move ((_4 as Err).0: i32); // scope 5 at $DIR/separate_const_switch.rs:29:8: 29:10
63 StorageLive(_12); // scope 7 at $DIR/separate_const_switch.rs:29:8: 29:10
64 StorageLive(_13); // scope 7 at $DIR/separate_const_switch.rs:29:8: 29:10
65 _13 = move _11; // scope 7 at $DIR/separate_const_switch.rs:29:8: 29:10
66 ((_12 as Err).0: i32) = move _13; // scope 7 at $DIR/separate_const_switch.rs:29:8: 29:10
67 discriminant(_12) = 1; // scope 7 at $DIR/separate_const_switch.rs:29:8: 29:10
68 StorageDead(_13); // scope 7 at $DIR/separate_const_switch.rs:29:8: 29:10
69 ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>) = move _12; // scope 7 at $DIR/separate_const_switch.rs:29:8: 29:10
70 discriminant(_3) = 1; // scope 7 at $DIR/separate_const_switch.rs:29:8: 29:10
71 StorageDead(_12); // scope 7 at $DIR/separate_const_switch.rs:29:8: 29:10
72 StorageDead(_11); // scope 5 at $DIR/separate_const_switch.rs:29:8: 29:10
73 StorageDead(_8); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
74 StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10
75 StorageLive(_5); // scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10
76 _5 = ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>); // scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10
77 StorageLive(_6); // scope 2 at $DIR/separate_const_switch.rs:29:9: 29:10
78 _6 = _5; // scope 2 at $DIR/separate_const_switch.rs:29:9: 29:10
79 StorageLive(_14); // scope 8 at $DIR/separate_const_switch.rs:29:8: 29:10
80 _14 = move ((_6 as Err).0: i32); // scope 8 at $DIR/separate_const_switch.rs:29:8: 29:10
81 StorageLive(_15); // scope 9 at $DIR/separate_const_switch.rs:29:8: 29:10
82 StorageLive(_16); // scope 9 at $DIR/separate_const_switch.rs:29:8: 29:10
83 _16 = move _14; // scope 9 at $DIR/separate_const_switch.rs:29:8: 29:10
84 _15 = move _16; // scope 10 at $DIR/separate_const_switch.rs:29:8: 29:10
85 StorageDead(_16); // scope 9 at $DIR/separate_const_switch.rs:29:8: 29:10
86 ((_0 as Err).0: i32) = move _15; // scope 9 at $DIR/separate_const_switch.rs:29:8: 29:10
87 discriminant(_0) = 1; // scope 9 at $DIR/separate_const_switch.rs:29:8: 29:10
88 StorageDead(_15); // scope 9 at $DIR/separate_const_switch.rs:29:8: 29:10
89 StorageDead(_14); // scope 8 at $DIR/separate_const_switch.rs:29:8: 29:10
90 StorageDead(_6); // scope 2 at $DIR/separate_const_switch.rs:29:9: 29:10
91 StorageDead(_5); // scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10
92 StorageDead(_2); // scope 0 at $DIR/separate_const_switch.rs:29:10: 29:11
93 StorageDead(_3); // scope 0 at $DIR/separate_const_switch.rs:30:1: 30:2
94 return; // scope 0 at $DIR/separate_const_switch.rs:30:2: 30:2
95 }
96
97 bb2: {
98 unreachable; // scope 5 at $DIR/separate_const_switch.rs:29:8: 29:10
99 }
100
101 bb3: {
102 StorageLive(_9); // scope 5 at $DIR/separate_const_switch.rs:29:8: 29:10
103 _9 = move ((_4 as Ok).0: i32); // scope 5 at $DIR/separate_const_switch.rs:29:8: 29:10
104 StorageLive(_10); // scope 6 at $DIR/separate_const_switch.rs:29:8: 29:10
105 _10 = move _9; // scope 6 at $DIR/separate_const_switch.rs:29:8: 29:10
106 ((_3 as Continue).0: i32) = move _10; // scope 6 at $DIR/separate_const_switch.rs:29:8: 29:10
107 discriminant(_3) = 0; // scope 6 at $DIR/separate_const_switch.rs:29:8: 29:10
108 StorageDead(_10); // scope 6 at $DIR/separate_const_switch.rs:29:8: 29:10
109 StorageDead(_9); // scope 5 at $DIR/separate_const_switch.rs:29:8: 29:10
110 StorageDead(_8); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
111 StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10
112 StorageLive(_7); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
113 _7 = ((_3 as Continue).0: i32); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
114 _2 = _7; // scope 4 at $DIR/separate_const_switch.rs:29:8: 29:10
115 StorageDead(_7); // scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10
116 ((_0 as Ok).0: i32) = move _2; // scope 0 at $DIR/separate_const_switch.rs:29:5: 29:11
117 discriminant(_0) = 0; // scope 0 at $DIR/separate_const_switch.rs:29:5: 29:11
118 StorageDead(_2); // scope 0 at $DIR/separate_const_switch.rs:29:10: 29:11
119 StorageDead(_3); // scope 0 at $DIR/separate_const_switch.rs:30:1: 30:2
120 return; // scope 0 at $DIR/separate_const_switch.rs:30:2: 30:2
121 }
122 }