Skip to content

Commit a282d5d

Browse files
committed
Fixed funky_arms (broken mir-opt test due to refactoring fmt::FormattingOptions)
1 parent 832a5f2 commit a282d5d

File tree

2 files changed

+144
-208
lines changed

2 files changed

+144
-208
lines changed

tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-abort.diff

Lines changed: 72 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,30 @@
77
debug upper => _3;
88
let mut _0: std::result::Result<(), std::fmt::Error>;
99
let _4: bool;
10-
let mut _6: std::option::Option<usize>;
11-
let mut _7: isize;
12-
let mut _9: &mut std::fmt::Formatter<'_>;
13-
let mut _10: &T;
14-
let mut _11: core::num::flt2dec::Sign;
15-
let mut _12: u32;
10+
let mut _5: &std::fmt::Formatter<'_>;
11+
let mut _7: std::option::Option<usize>;
12+
let mut _8: isize;
13+
let mut _10: &mut std::fmt::Formatter<'_>;
14+
let mut _11: &T;
15+
let mut _12: core::num::flt2dec::Sign;
1616
let mut _13: u32;
17-
let mut _14: usize;
18-
let mut _15: bool;
19-
let mut _16: &mut std::fmt::Formatter<'_>;
20-
let mut _17: &T;
21-
let mut _18: core::num::flt2dec::Sign;
22-
let mut _19: bool;
17+
let mut _14: u32;
18+
let mut _15: usize;
19+
let mut _16: bool;
20+
let mut _17: &mut std::fmt::Formatter<'_>;
21+
let mut _18: &T;
22+
let mut _19: core::num::flt2dec::Sign;
23+
let mut _20: bool;
2324
scope 1 {
2425
debug force_sign => _4;
25-
let _5: core::num::flt2dec::Sign;
26+
let _6: core::num::flt2dec::Sign;
2627
scope 2 {
27-
debug sign => _5;
28+
debug sign => _6;
2829
scope 3 {
29-
debug precision => _8;
30-
let _8: usize;
31-
scope 11 (inlined Formatter::<'_>::precision) {
32-
scope 12 (inlined FormattingOptions::get_precision) {
33-
}
34-
}
35-
}
36-
}
37-
}
38-
scope 4 (inlined Formatter::<'_>::sign_plus) {
39-
let _20: std::option::Option<std::fmt::Sign>;
40-
scope 5 (inlined FormattingOptions::get_sign) {
41-
}
42-
scope 6 (inlined <Option<std::fmt::Sign> as PartialEq>::eq) {
43-
let mut _21: isize;
44-
scope 7 {
45-
scope 8 (inlined <std::fmt::Sign as PartialEq>::eq) {
46-
let _22: isize;
47-
scope 9 {
48-
scope 10 {
49-
}
30+
debug precision => _9;
31+
let _9: usize;
32+
scope 4 (inlined Formatter::<'_>::precision) {
33+
scope 5 (inlined FormattingOptions::get_precision) {
5034
}
5135
}
5236
}
@@ -55,118 +39,102 @@
5539

5640
bb0: {
5741
StorageLive(_4);
58-
StorageLive(_20);
59-
_20 = copy (((*_1).0: std::fmt::FormattingOptions).0: std::option::Option<std::fmt::Sign>);
60-
StorageLive(_21);
61-
_21 = discriminant(_20);
62-
switchInt(move _21) -> [0: bb11, 1: bb12, otherwise: bb10];
42+
StorageLive(_5);
43+
_5 = &(*_1);
44+
_4 = Formatter::<'_>::sign_plus(move _5) -> [return: bb1, unwind unreachable];
6345
}
6446

6547
bb1: {
66-
- _5 = MinusPlus;
67-
+ _5 = const MinusPlus;
68-
goto -> bb3;
48+
StorageDead(_5);
49+
StorageLive(_6);
50+
switchInt(copy _4) -> [0: bb3, otherwise: bb2];
6951
}
7052

7153
bb2: {
72-
- _5 = core::num::flt2dec::Sign::Minus;
73-
+ _5 = const core::num::flt2dec::Sign::Minus;
74-
goto -> bb3;
54+
- _6 = MinusPlus;
55+
+ _6 = const MinusPlus;
56+
goto -> bb4;
7557
}
7658

7759
bb3: {
78-
StorageLive(_6);
79-
_6 = copy (((*_1).0: std::fmt::FormattingOptions).6: std::option::Option<usize>);
80-
_7 = discriminant(_6);
81-
switchInt(move _7) -> [1: bb4, 0: bb6, otherwise: bb10];
60+
- _6 = core::num::flt2dec::Sign::Minus;
61+
+ _6 = const core::num::flt2dec::Sign::Minus;
62+
goto -> bb4;
8263
}
8364

8465
bb4: {
85-
- StorageLive(_8);
66+
StorageLive(_7);
67+
_7 = copy (((*_1).0: std::fmt::FormattingOptions).4: std::option::Option<usize>);
68+
_8 = discriminant(_7);
69+
switchInt(move _8) -> [1: bb5, 0: bb7, otherwise: bb10];
70+
}
71+
72+
bb5: {
73+
- StorageLive(_9);
8674
+ nop;
87-
_8 = copy ((_6 as Some).0: usize);
88-
StorageLive(_9);
89-
_9 = copy _1;
75+
_9 = copy ((_7 as Some).0: usize);
9076
StorageLive(_10);
91-
_10 = copy _2;
77+
_10 = copy _1;
9278
StorageLive(_11);
93-
_11 = copy _5;
79+
_11 = copy _2;
9480
StorageLive(_12);
81+
_12 = copy _6;
9582
StorageLive(_13);
9683
StorageLive(_14);
97-
_14 = copy _8;
98-
- _13 = move _14 as u32 (IntToInt);
99-
+ _13 = copy _8 as u32 (IntToInt);
100-
StorageDead(_14);
101-
_12 = Add(move _13, const 1_u32);
102-
StorageDead(_13);
10384
StorageLive(_15);
104-
_15 = copy _3;
105-
- _0 = float_to_exponential_common_exact::<T>(move _9, move _10, move _11, move _12, move _15) -> [return: bb5, unwind unreachable];
106-
+ _0 = float_to_exponential_common_exact::<T>(copy _1, copy _2, move _11, move _12, copy _3) -> [return: bb5, unwind unreachable];
85+
_15 = copy _9;
86+
- _14 = move _15 as u32 (IntToInt);
87+
+ _14 = copy _9 as u32 (IntToInt);
88+
StorageDead(_15);
89+
_13 = Add(move _14, const 1_u32);
90+
StorageDead(_14);
91+
StorageLive(_16);
92+
_16 = copy _3;
93+
- _0 = float_to_exponential_common_exact::<T>(move _10, move _11, move _12, move _13, move _16) -> [return: bb6, unwind unreachable];
94+
+ _0 = float_to_exponential_common_exact::<T>(copy _1, copy _2, move _12, move _13, copy _3) -> [return: bb6, unwind unreachable];
10795
}
10896

109-
bb5: {
110-
StorageDead(_15);
97+
bb6: {
98+
StorageDead(_16);
99+
StorageDead(_13);
111100
StorageDead(_12);
112101
StorageDead(_11);
113102
StorageDead(_10);
114-
StorageDead(_9);
115-
- StorageDead(_8);
103+
- StorageDead(_9);
116104
+ nop;
117-
goto -> bb8;
105+
goto -> bb9;
118106
}
119107

120-
bb6: {
121-
StorageLive(_16);
122-
_16 = copy _1;
108+
bb7: {
123109
StorageLive(_17);
124-
_17 = copy _2;
110+
_17 = copy _1;
125111
StorageLive(_18);
126-
_18 = copy _5;
112+
_18 = copy _2;
127113
StorageLive(_19);
128-
_19 = copy _3;
129-
- _0 = float_to_exponential_common_shortest::<T>(move _16, move _17, move _18, move _19) -> [return: bb7, unwind unreachable];
130-
+ _0 = float_to_exponential_common_shortest::<T>(copy _1, copy _2, move _18, copy _3) -> [return: bb7, unwind unreachable];
114+
_19 = copy _6;
115+
StorageLive(_20);
116+
_20 = copy _3;
117+
- _0 = float_to_exponential_common_shortest::<T>(move _17, move _18, move _19, move _20) -> [return: bb8, unwind unreachable];
118+
+ _0 = float_to_exponential_common_shortest::<T>(copy _1, copy _2, move _19, copy _3) -> [return: bb8, unwind unreachable];
131119
}
132120

133-
bb7: {
121+
bb8: {
122+
StorageDead(_20);
134123
StorageDead(_19);
135124
StorageDead(_18);
136125
StorageDead(_17);
137-
StorageDead(_16);
138-
goto -> bb8;
126+
goto -> bb9;
139127
}
140128

141-
bb8: {
142-
StorageDead(_5);
143-
StorageDead(_4);
129+
bb9: {
144130
StorageDead(_6);
131+
StorageDead(_4);
132+
StorageDead(_7);
145133
return;
146134
}
147135

148-
bb9: {
149-
StorageDead(_21);
150-
StorageDead(_20);
151-
StorageLive(_5);
152-
switchInt(copy _4) -> [0: bb2, otherwise: bb1];
153-
}
154-
155136
bb10: {
156137
unreachable;
157138
}
158-
159-
bb11: {
160-
_4 = const false;
161-
goto -> bb9;
162-
}
163-
164-
bb12: {
165-
StorageLive(_22);
166-
_22 = discriminant(((_20 as Some).0: std::fmt::Sign));
167-
_4 = Eq(copy _22, const 0_isize);
168-
StorageDead(_22);
169-
goto -> bb9;
170-
}
171139
}
172140

0 commit comments

Comments
 (0)