Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 1c50fbf

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

File tree

2 files changed

+154
-314
lines changed

2 files changed

+154
-314
lines changed

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

Lines changed: 77 additions & 157 deletions
Original file line numberDiff line numberDiff line change
@@ -7,70 +7,33 @@
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 12 (inlined Formatter::<'_>::precision) {
30+
debug precision => _9;
31+
let _9: usize;
32+
scope 4 (inlined Formatter::<'_>::precision) {
3233
debug self => _1;
33-
let mut _30: &std::fmt::FormattingOptions;
34-
scope 13 (inlined FormattingOptions::get_precision) {
35-
debug self => _30;
36-
}
37-
}
38-
}
39-
}
40-
}
41-
scope 4 (inlined Formatter::<'_>::sign_plus) {
42-
debug self => _1;
43-
let mut _20: &std::option::Option<std::fmt::Sign>;
44-
let _21: std::option::Option<std::fmt::Sign>;
45-
let mut _22: &std::fmt::FormattingOptions;
46-
let mut _23: &std::option::Option<std::fmt::Sign>;
47-
scope 5 (inlined FormattingOptions::get_sign) {
48-
debug self => _22;
49-
}
50-
scope 6 (inlined <Option<std::fmt::Sign> as PartialEq>::eq) {
51-
debug self => _20;
52-
debug other => const _;
53-
scope 7 (inlined <std::fmt::Sign as SpecOptionPartialEq>::eq) {
54-
debug l => _20;
55-
debug r => const _;
56-
let mut _24: isize;
57-
let _25: &std::fmt::Sign;
58-
let _26: &std::fmt::Sign;
59-
let mut _27: &std::fmt::Sign;
60-
let mut _28: &std::fmt::Sign;
61-
scope 8 {
62-
debug l => _25;
63-
debug r => _26;
64-
scope 9 (inlined <std::fmt::Sign as PartialEq>::eq) {
65-
debug self => _27;
66-
debug other => _28;
67-
let _29: isize;
68-
scope 10 {
69-
debug __self_tag => _29;
70-
scope 11 {
71-
debug __arg1_tag => const 0_isize;
72-
}
73-
}
34+
let mut _21: &std::fmt::FormattingOptions;
35+
scope 5 (inlined FormattingOptions::get_precision) {
36+
debug self => _21;
7437
}
7538
}
7639
}
@@ -79,144 +42,101 @@
7942

8043
bb0: {
8144
StorageLive(_4);
82-
- StorageLive(_23);
83-
+ nop;
84-
StorageLive(_20);
85-
StorageLive(_21);
86-
StorageLive(_22);
87-
_22 = &((*_1).0: std::fmt::FormattingOptions);
88-
_21 = (((*_1).0: std::fmt::FormattingOptions).0: std::option::Option<std::fmt::Sign>);
89-
_20 = &_21;
90-
StorageDead(_22);
91-
_23 = const _;
92-
StorageLive(_24);
93-
_24 = discriminant(_21);
94-
switchInt(move _24) -> [0: bb10, 1: bb11, otherwise: bb12];
45+
StorageLive(_5);
46+
_5 = &(*_1);
47+
_4 = Formatter::<'_>::sign_plus(move _5) -> [return: bb1, unwind unreachable];
9548
}
9649

9750
bb1: {
98-
- _5 = MinusPlus;
99-
+ _5 = const MinusPlus;
100-
goto -> bb3;
51+
StorageDead(_5);
52+
StorageLive(_6);
53+
switchInt(_4) -> [0: bb3, otherwise: bb2];
10154
}
10255

10356
bb2: {
104-
- _5 = core::num::flt2dec::Sign::Minus;
105-
+ _5 = const core::num::flt2dec::Sign::Minus;
106-
goto -> bb3;
57+
- _6 = MinusPlus;
58+
+ _6 = const MinusPlus;
59+
goto -> bb4;
10760
}
10861

10962
bb3: {
110-
StorageLive(_6);
111-
StorageLive(_30);
112-
_30 = &((*_1).0: std::fmt::FormattingOptions);
113-
_6 = (((*_1).0: std::fmt::FormattingOptions).6: std::option::Option<usize>);
114-
StorageDead(_30);
115-
_7 = discriminant(_6);
116-
switchInt(move _7) -> [1: bb4, otherwise: bb6];
63+
- _6 = core::num::flt2dec::Sign::Minus;
64+
+ _6 = const core::num::flt2dec::Sign::Minus;
65+
goto -> bb4;
11766
}
11867

11968
bb4: {
120-
- StorageLive(_8);
69+
StorageLive(_7);
70+
StorageLive(_21);
71+
_21 = &((*_1).0: std::fmt::FormattingOptions);
72+
_7 = (((*_1).0: std::fmt::FormattingOptions).4: std::option::Option<usize>);
73+
StorageDead(_21);
74+
_8 = discriminant(_7);
75+
switchInt(move _8) -> [1: bb5, otherwise: bb7];
76+
}
77+
78+
bb5: {
79+
- StorageLive(_9);
12180
+ nop;
122-
_8 = ((_6 as Some).0: usize);
123-
StorageLive(_9);
124-
_9 = _1;
81+
_9 = ((_7 as Some).0: usize);
12582
StorageLive(_10);
126-
_10 = _2;
83+
_10 = _1;
12784
StorageLive(_11);
128-
_11 = _5;
85+
_11 = _2;
12986
StorageLive(_12);
87+
_12 = _6;
13088
StorageLive(_13);
13189
StorageLive(_14);
132-
_14 = _8;
133-
- _13 = move _14 as u32 (IntToInt);
134-
+ _13 = _8 as u32 (IntToInt);
135-
StorageDead(_14);
136-
_12 = Add(move _13, const 1_u32);
137-
StorageDead(_13);
13890
StorageLive(_15);
139-
_15 = _3;
140-
- _0 = float_to_exponential_common_exact::<T>(move _9, move _10, move _11, move _12, move _15) -> [return: bb5, unwind unreachable];
141-
+ _0 = float_to_exponential_common_exact::<T>(_1, _2, move _11, move _12, _3) -> [return: bb5, unwind unreachable];
91+
_15 = _9;
92+
- _14 = move _15 as u32 (IntToInt);
93+
+ _14 = _9 as u32 (IntToInt);
94+
StorageDead(_15);
95+
_13 = Add(move _14, const 1_u32);
96+
StorageDead(_14);
97+
StorageLive(_16);
98+
_16 = _3;
99+
- _0 = float_to_exponential_common_exact::<T>(move _10, move _11, move _12, move _13, move _16) -> [return: bb6, unwind unreachable];
100+
+ _0 = float_to_exponential_common_exact::<T>(_1, _2, move _12, move _13, _3) -> [return: bb6, unwind unreachable];
142101
}
143102

144-
bb5: {
145-
StorageDead(_15);
103+
bb6: {
104+
StorageDead(_16);
105+
StorageDead(_13);
146106
StorageDead(_12);
147107
StorageDead(_11);
148108
StorageDead(_10);
149-
StorageDead(_9);
150-
- StorageDead(_8);
109+
- StorageDead(_9);
151110
+ nop;
152-
goto -> bb8;
111+
goto -> bb9;
153112
}
154113

155-
bb6: {
156-
StorageLive(_16);
157-
_16 = _1;
114+
bb7: {
158115
StorageLive(_17);
159-
_17 = _2;
116+
_17 = _1;
160117
StorageLive(_18);
161-
_18 = _5;
118+
_18 = _2;
162119
StorageLive(_19);
163-
_19 = _3;
164-
- _0 = float_to_exponential_common_shortest::<T>(move _16, move _17, move _18, move _19) -> [return: bb7, unwind unreachable];
165-
+ _0 = float_to_exponential_common_shortest::<T>(_1, _2, move _18, _3) -> [return: bb7, unwind unreachable];
120+
_19 = _6;
121+
StorageLive(_20);
122+
_20 = _3;
123+
- _0 = float_to_exponential_common_shortest::<T>(move _17, move _18, move _19, move _20) -> [return: bb8, unwind unreachable];
124+
+ _0 = float_to_exponential_common_shortest::<T>(_1, _2, move _19, _3) -> [return: bb8, unwind unreachable];
166125
}
167126

168-
bb7: {
127+
bb8: {
128+
StorageDead(_20);
169129
StorageDead(_19);
170130
StorageDead(_18);
171131
StorageDead(_17);
172-
StorageDead(_16);
173-
goto -> bb8;
132+
goto -> bb9;
174133
}
175134

176-
bb8: {
177-
StorageDead(_5);
178-
StorageDead(_4);
135+
bb9: {
179136
StorageDead(_6);
137+
StorageDead(_4);
138+
StorageDead(_7);
180139
return;
181140
}
182-
183-
bb9: {
184-
StorageDead(_24);
185-
StorageDead(_20);
186-
StorageDead(_21);
187-
- StorageDead(_23);
188-
+ nop;
189-
StorageLive(_5);
190-
switchInt(_4) -> [0: bb2, otherwise: bb1];
191-
}
192-
193-
bb10: {
194-
_4 = const false;
195-
goto -> bb9;
196-
}
197-
198-
bb11: {
199-
StorageLive(_25);
200-
_25 = &((_21 as Some).0: std::fmt::Sign);
201-
StorageLive(_26);
202-
_26 = &(((*_23) as Some).0: std::fmt::Sign);
203-
StorageLive(_27);
204-
_27 = &((_21 as Some).0: std::fmt::Sign);
205-
StorageLive(_28);
206-
_28 = &(((*_23) as Some).0: std::fmt::Sign);
207-
StorageLive(_29);
208-
_29 = discriminant(((_21 as Some).0: std::fmt::Sign));
209-
_4 = Eq(_29, const 0_isize);
210-
StorageDead(_29);
211-
StorageDead(_28);
212-
StorageDead(_27);
213-
StorageDead(_26);
214-
StorageDead(_25);
215-
goto -> bb9;
216-
}
217-
218-
bb12: {
219-
unreachable;
220-
}
221141
}
222142

0 commit comments

Comments
 (0)