Skip to content

Commit b0b4212

Browse files
committed
Bless separate_const_switch MIR opt test.
This test had some regressions due to the change in enum deaggregation. For now we accept these, as they do not show up on perf, and hope that future improvements can recover the previous result.
1 parent 8a153cc commit b0b4212

7 files changed

+376
-359
lines changed

src/test/mir-opt/separate_const_switch.identity.ConstProp.diff

+49-53
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
+ // MIR for `identity` after ConstProp
33

44
fn identity(_1: Result<i32, i32>) -> Result<i32, i32> {
5-
debug x => _1; // in scope 0 at $DIR/separate_const_switch.rs:28:13: 28:14
6-
let mut _0: std::result::Result<i32, i32>; // return place in scope 0 at $DIR/separate_const_switch.rs:28:37: 28:53
7-
let mut _2: i32; // in scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
8-
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
9-
let mut _4: std::result::Result<i32, i32>; // in scope 0 at $DIR/separate_const_switch.rs:29:8: 29:9
10-
let mut _5: isize; // in scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10
11-
let _6: std::result::Result<std::convert::Infallible, i32>; // in scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10
12-
let mut _7: !; // in scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10
13-
let mut _8: std::result::Result<std::convert::Infallible, i32>; // in scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10
14-
let _9: i32; // in scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
5+
debug x => _1; // in scope 0 at $DIR/separate_const_switch.rs:31:13: 31:14
6+
let mut _0: std::result::Result<i32, i32>; // return place in scope 0 at $DIR/separate_const_switch.rs:31:37: 31:53
7+
let mut _2: i32; // in scope 0 at $DIR/separate_const_switch.rs:32:8: 32:10
8+
let mut _3: std::ops::ControlFlow<std::result::Result<std::convert::Infallible, i32>, i32>; // in scope 0 at $DIR/separate_const_switch.rs:32:8: 32:10
9+
let mut _4: std::result::Result<i32, i32>; // in scope 0 at $DIR/separate_const_switch.rs:32:8: 32:9
10+
let mut _5: isize; // in scope 0 at $DIR/separate_const_switch.rs:32:9: 32:10
11+
let _6: std::result::Result<std::convert::Infallible, i32>; // in scope 0 at $DIR/separate_const_switch.rs:32:9: 32:10
12+
let mut _7: !; // in scope 0 at $DIR/separate_const_switch.rs:32:9: 32:10
13+
let mut _8: std::result::Result<std::convert::Infallible, i32>; // in scope 0 at $DIR/separate_const_switch.rs:32:9: 32:10
14+
let _9: i32; // in scope 0 at $DIR/separate_const_switch.rs:32:8: 32:10
1515
scope 1 {
16-
debug residual => _6; // in scope 1 at $DIR/separate_const_switch.rs:29:9: 29:10
16+
debug residual => _6; // in scope 1 at $DIR/separate_const_switch.rs:32:9: 32:10
1717
scope 2 {
18-
scope 8 (inlined #[track_caller] <Result<i32, i32> as FromResidual<Result<Infallible, i32>>>::from_residual) { // at $DIR/separate_const_switch.rs:29:8: 29:10
18+
scope 8 (inlined #[track_caller] <Result<i32, i32> as FromResidual<Result<Infallible, i32>>>::from_residual) { // at $DIR/separate_const_switch.rs:32:8: 32:10
1919
debug residual => _8; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
2020
let _16: i32; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
2121
let mut _17: i32; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
@@ -30,11 +30,11 @@
3030
}
3131
}
3232
scope 3 {
33-
debug val => _9; // in scope 3 at $DIR/separate_const_switch.rs:29:8: 29:10
33+
debug val => _9; // in scope 3 at $DIR/separate_const_switch.rs:32:8: 32:10
3434
scope 4 {
3535
}
3636
}
37-
scope 5 (inlined <Result<i32, i32> as Try>::branch) { // at $DIR/separate_const_switch.rs:29:8: 29:10
37+
scope 5 (inlined <Result<i32, i32> as Try>::branch) { // at $DIR/separate_const_switch.rs:32:8: 32:10
3838
debug self => _4; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
3939
let mut _10: isize; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
4040
let _11: i32; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
@@ -51,48 +51,48 @@
5151
}
5252

5353
bb0: {
54-
StorageLive(_2); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
55-
StorageLive(_3); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
56-
StorageLive(_4); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:9
57-
_4 = _1; // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:9
58-
StorageLive(_10); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
54+
StorageLive(_2); // scope 0 at $DIR/separate_const_switch.rs:32:8: 32:10
55+
StorageLive(_3); // scope 0 at $DIR/separate_const_switch.rs:32:8: 32:10
56+
StorageLive(_4); // scope 0 at $DIR/separate_const_switch.rs:32:8: 32:9
57+
_4 = _1; // scope 0 at $DIR/separate_const_switch.rs:32:8: 32:9
58+
StorageLive(_10); // scope 0 at $DIR/separate_const_switch.rs:32:8: 32:10
5959
_10 = discriminant(_4); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
6060
switchInt(move _10) -> [0_isize: bb5, 1_isize: bb3, otherwise: bb4]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
6161
}
6262

6363
bb1: {
64-
StorageLive(_9); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
65-
_9 = ((_3 as Continue).0: i32); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
66-
_2 = _9; // scope 4 at $DIR/separate_const_switch.rs:29:8: 29:10
67-
StorageDead(_9); // scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10
68-
((_0 as Ok).0: i32) = move _2; // scope 0 at $DIR/separate_const_switch.rs:29:5: 29:11
69-
discriminant(_0) = 0; // scope 0 at $DIR/separate_const_switch.rs:29:5: 29:11
70-
StorageDead(_2); // scope 0 at $DIR/separate_const_switch.rs:29:10: 29:11
71-
StorageDead(_3); // scope 0 at $DIR/separate_const_switch.rs:30:1: 30:2
72-
return; // scope 0 at $DIR/separate_const_switch.rs:30:2: 30:2
64+
StorageLive(_9); // scope 0 at $DIR/separate_const_switch.rs:32:8: 32:10
65+
_9 = ((_3 as Continue).0: i32); // scope 0 at $DIR/separate_const_switch.rs:32:8: 32:10
66+
_2 = _9; // scope 4 at $DIR/separate_const_switch.rs:32:8: 32:10
67+
StorageDead(_9); // scope 0 at $DIR/separate_const_switch.rs:32:9: 32:10
68+
discriminant(_0) = 0; // scope 0 at $DIR/separate_const_switch.rs:32:5: 32:11
69+
((_0 as Ok).0: i32) = move _2; // scope 0 at $DIR/separate_const_switch.rs:32:5: 32:11
70+
StorageDead(_2); // scope 0 at $DIR/separate_const_switch.rs:32:10: 32:11
71+
StorageDead(_3); // scope 0 at $DIR/separate_const_switch.rs:33:1: 33:2
72+
return; // scope 0 at $DIR/separate_const_switch.rs:33:2: 33:2
7373
}
7474

7575
bb2: {
76-
StorageLive(_6); // scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10
77-
_6 = ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>); // scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10
78-
StorageLive(_8); // scope 2 at $DIR/separate_const_switch.rs:29:9: 29:10
79-
_8 = _6; // scope 2 at $DIR/separate_const_switch.rs:29:9: 29:10
76+
StorageLive(_6); // scope 0 at $DIR/separate_const_switch.rs:32:9: 32:10
77+
_6 = ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>); // scope 0 at $DIR/separate_const_switch.rs:32:9: 32:10
78+
StorageLive(_8); // scope 2 at $DIR/separate_const_switch.rs:32:9: 32:10
79+
_8 = _6; // scope 2 at $DIR/separate_const_switch.rs:32:9: 32:10
8080
StorageLive(_16); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
8181
_16 = move ((_8 as Err).0: i32); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
8282
StorageLive(_17); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
8383
StorageLive(_18); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
8484
_18 = move _16; // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
8585
_17 = move _18; // scope 10 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
8686
StorageDead(_18); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
87-
((_0 as Err).0: i32) = move _17; // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
8887
discriminant(_0) = 1; // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
88+
((_0 as Err).0: i32) = move _17; // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
8989
StorageDead(_17); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
9090
StorageDead(_16); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
91-
StorageDead(_8); // scope 2 at $DIR/separate_const_switch.rs:29:9: 29:10
92-
StorageDead(_6); // scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10
93-
StorageDead(_2); // scope 0 at $DIR/separate_const_switch.rs:29:10: 29:11
94-
StorageDead(_3); // scope 0 at $DIR/separate_const_switch.rs:30:1: 30:2
95-
return; // scope 0 at $DIR/separate_const_switch.rs:30:2: 30:2
91+
StorageDead(_8); // scope 2 at $DIR/separate_const_switch.rs:32:9: 32:10
92+
StorageDead(_6); // scope 0 at $DIR/separate_const_switch.rs:32:9: 32:10
93+
StorageDead(_2); // scope 0 at $DIR/separate_const_switch.rs:32:10: 32:11
94+
StorageDead(_3); // scope 0 at $DIR/separate_const_switch.rs:33:1: 33:2
95+
return; // scope 0 at $DIR/separate_const_switch.rs:33:2: 33:2
9696
}
9797

9898
bb3: {
@@ -101,19 +101,17 @@
101101
StorageLive(_14); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
102102
StorageLive(_15); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
103103
_15 = move _13; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
104-
((_14 as Err).0: i32) = move _15; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
105104
discriminant(_14) = 1; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
105+
((_14 as Err).0: i32) = move _15; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
106106
StorageDead(_15); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
107-
((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>) = move _14; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
108107
discriminant(_3) = 1; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
108+
((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>) = move _14; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
109109
StorageDead(_14); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
110110
StorageDead(_13); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
111-
StorageDead(_10); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
112-
StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10
113-
- _5 = discriminant(_3); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
114-
- switchInt(move _5) -> [0_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
115-
+ _5 = const 1_isize; // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
116-
+ switchInt(const 1_isize) -> [0_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
111+
StorageDead(_10); // scope 0 at $DIR/separate_const_switch.rs:32:8: 32:10
112+
StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:32:9: 32:10
113+
_5 = discriminant(_3); // scope 0 at $DIR/separate_const_switch.rs:32:8: 32:10
114+
switchInt(move _5) -> [0_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:32:8: 32:10
117115
}
118116

119117
bb4: {
@@ -125,16 +123,14 @@
125123
_11 = move ((_4 as Ok).0: i32); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
126124
StorageLive(_12); // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
127125
_12 = move _11; // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
128-
((_3 as Continue).0: i32) = move _12; // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
129126
discriminant(_3) = 0; // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
127+
((_3 as Continue).0: i32) = move _12; // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
130128
StorageDead(_12); // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
131129
StorageDead(_11); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
132-
StorageDead(_10); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
133-
StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10
134-
- _5 = discriminant(_3); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
135-
- switchInt(move _5) -> [0_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
136-
+ _5 = const 0_isize; // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
137-
+ switchInt(const 0_isize) -> [0_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
130+
StorageDead(_10); // scope 0 at $DIR/separate_const_switch.rs:32:8: 32:10
131+
StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:32:9: 32:10
132+
_5 = discriminant(_3); // scope 0 at $DIR/separate_const_switch.rs:32:8: 32:10
133+
switchInt(move _5) -> [0_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:32:8: 32:10
138134
}
139135
}
140136

0 commit comments

Comments
 (0)