Skip to content

Commit 6eda764

Browse files
committed
Auto merge of #96549 - ouz-a:mir-opt, r=oli-obk
Move Derefer before Retag _Follow up work to #96116 #95857 #95649_ This moves `Derefer` before `Retag` and creates a new `LocalInfo` called `Temp` to avoid retagging created temp values. Zulip discussion [link](https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/deref.20as.20first.20and.20only.20projection) r? `@oli-obk`
2 parents 508e058 + d9ddb64 commit 6eda764

File tree

35 files changed

+69
-148
lines changed

35 files changed

+69
-148
lines changed

compiler/rustc_middle/src/mir/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,8 @@ pub enum LocalInfo<'tcx> {
10871087
/// A temporary created during the creation of an aggregate
10881088
/// (e.g. a temporary for `foo` in `MyStruct { my_field: foo }`)
10891089
AggregateTemp,
1090+
/// A temporary created during the pass `Derefer` to avoid it's retagging
1091+
DerefTemp,
10901092
}
10911093

10921094
impl<'tcx> LocalDecl<'tcx> {

compiler/rustc_middle/src/mir/patch.rs

+13-2
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,24 @@ impl<'tcx> MirPatch<'tcx> {
7878
Location { block: bb, statement_index: offset }
7979
}
8080

81-
pub fn new_temp(&mut self, ty: Ty<'tcx>, span: Span) -> Local {
81+
pub fn new_local_with_info(
82+
&mut self,
83+
ty: Ty<'tcx>,
84+
span: Span,
85+
local_info: Option<Box<LocalInfo<'tcx>>>,
86+
) -> Local {
8287
let index = self.next_local;
8388
self.next_local += 1;
84-
self.new_locals.push(LocalDecl::new(ty, span));
89+
let mut new_decl = LocalDecl::new(ty, span);
90+
new_decl.local_info = local_info;
91+
self.new_locals.push(new_decl);
8592
Local::new(index as usize)
8693
}
8794

95+
pub fn new_temp(&mut self, ty: Ty<'tcx>, span: Span) -> Local {
96+
self.new_local_with_info(ty, span, None)
97+
}
98+
8899
pub fn new_internal(&mut self, ty: Ty<'tcx>, span: Span) -> Local {
89100
let index = self.next_local;
90101
self.next_local += 1;

compiler/rustc_mir_transform/src/add_retag.rs

+14-1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,17 @@ fn may_be_reference(ty: Ty<'_>) -> bool {
5757
}
5858
}
5959

60+
/// Determines whether or not this LocalDecl is temp, if not it needs retagging.
61+
fn is_not_temp<'tcx>(local_decl: &LocalDecl<'tcx>) -> bool {
62+
if let Some(local_info) = &local_decl.local_info {
63+
match local_info.as_ref() {
64+
LocalInfo::DerefTemp => return false,
65+
_ => (),
66+
};
67+
}
68+
return true;
69+
}
70+
6071
impl<'tcx> MirPass<'tcx> for AddRetag {
6172
fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
6273
sess.opts.debugging_opts.mir_emit_retag
@@ -71,7 +82,9 @@ impl<'tcx> MirPass<'tcx> for AddRetag {
7182
let needs_retag = |place: &Place<'tcx>| {
7283
// FIXME: Instead of giving up for unstable places, we should introduce
7384
// a temporary and retag on that.
74-
is_stable(place.as_ref()) && may_be_reference(place.ty(&*local_decls, tcx).ty)
85+
is_stable(place.as_ref())
86+
&& may_be_reference(place.ty(&*local_decls, tcx).ty)
87+
&& is_not_temp(&local_decls[place.local])
7588
};
7689
let place_base_raw = |place: &Place<'tcx>| {
7790
// If this is a `Deref`, get the type of what we are deref'ing.

compiler/rustc_mir_transform/src/deref_separator.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,24 @@ impl<'tcx> MutVisitor<'tcx> for DerefChecker<'tcx> {
3333
for (idx, (p_ref, p_elem)) in place.iter_projections().enumerate() {
3434
if p_elem == ProjectionElem::Deref && !p_ref.projection.is_empty() {
3535
let ty = p_ref.ty(&self.local_decls, self.tcx).ty;
36-
let temp =
37-
self.patcher.new_temp(ty, self.local_decls[p_ref.local].source_info.span);
36+
let temp = self.patcher.new_local_with_info(
37+
ty,
38+
self.local_decls[p_ref.local].source_info.span,
39+
Some(Box::new(LocalInfo::DerefTemp)),
40+
);
3841

3942
self.patcher.add_statement(loc, StatementKind::StorageLive(temp));
4043

4144
// We are adding current p_ref's projections to our
4245
// temp value, excluding projections we already covered.
4346
let deref_place = Place::from(place_local)
4447
.project_deeper(&p_ref.projection[last_len..], self.tcx);
48+
4549
self.patcher.add_assign(
4650
loc,
4751
Place::from(temp),
4852
Rvalue::Use(Operand::Move(deref_place)),
4953
);
50-
5154
place_local = temp;
5255
last_len = p_ref.projection.len();
5356

@@ -58,7 +61,7 @@ impl<'tcx> MutVisitor<'tcx> for DerefChecker<'tcx> {
5861
*place = temp_place;
5962
}
6063

61-
// We are destroying last temp since it's no longer used.
64+
// We are destroying the previous temp since it's no longer used.
6265
if let Some(prev_temp) = prev_temp {
6366
self.patcher.add_statement(loc, StatementKind::StorageDead(prev_temp));
6467
}

compiler/rustc_mir_transform/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -426,13 +426,13 @@ fn run_post_borrowck_cleanup_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tc
426426
&add_moves_for_packed_drops::AddMovesForPackedDrops,
427427
// `AddRetag` needs to run after `ElaborateDrops`. Otherwise it should run fairly late,
428428
// but before optimizations begin.
429+
&deref_separator::Derefer,
429430
&add_retag::AddRetag,
430431
&lower_intrinsics::LowerIntrinsics,
431432
&simplify::SimplifyCfg::new("elaborate-drops"),
432433
// `Deaggregator` is conceptually part of MIR building, some backends rely on it happening
433434
// and it can help optimizations.
434435
&deaggregator::Deaggregator,
435-
&deref_separator::Derefer,
436436
&Lint(const_prop_lint::ConstProp),
437437
];
438438

src/test/mir-opt/derefer_complex_case.main.Derefer.diff

+4-4
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@
102102
StorageDead(_6); // scope 1 at $DIR/derefer_complex_case.rs:4:39: 4:40
103103
_5 = const (); // scope 1 at $DIR/derefer_complex_case.rs:4:5: 4:40
104104
goto -> bb2; // scope 1 at $DIR/derefer_complex_case.rs:4:5: 4:40
105-
+ }
106-
+
107-
+ bb8 (cleanup): {
108-
+ resume; // scope 0 at $DIR/derefer_complex_case.rs:3:1: 5:2
105+
}
106+
107+
bb8 (cleanup): {
108+
resume; // scope 0 at $DIR/derefer_complex_case.rs:3:1: 5:2
109109
}
110110
}
111111

src/test/mir-opt/derefer_terminator_test.main.Derefer.diff

+4-4
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@
9494
StorageDead(_2); // scope 1 at $DIR/derefer_terminator_test.rs:10:1: 10:2
9595
StorageDead(_1); // scope 0 at $DIR/derefer_terminator_test.rs:10:1: 10:2
9696
return; // scope 0 at $DIR/derefer_terminator_test.rs:10:2: 10:2
97-
+ }
98-
+
99-
+ bb6 (cleanup): {
100-
+ resume; // scope 0 at $DIR/derefer_terminator_test.rs:2:1: 10:2
97+
}
98+
99+
bb6 (cleanup): {
100+
resume; // scope 0 at $DIR/derefer_terminator_test.rs:2:1: 10:2
101101
}
102102
}
103103

src/test/mir-opt/derefer_test.main.Derefer.diff

+6-10
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,11 @@
2525

2626
bb0: {
2727
StorageLive(_1); // scope 0 at $DIR/derefer_test.rs:3:9: 3:14
28-
Deinit(_1); // scope 0 at $DIR/derefer_test.rs:3:17: 3:24
29-
(_1.0: i32) = const 42_i32; // scope 0 at $DIR/derefer_test.rs:3:17: 3:24
30-
(_1.1: i32) = const 43_i32; // scope 0 at $DIR/derefer_test.rs:3:17: 3:24
28+
_1 = (const 42_i32, const 43_i32); // scope 0 at $DIR/derefer_test.rs:3:17: 3:24
3129
StorageLive(_2); // scope 1 at $DIR/derefer_test.rs:4:9: 4:14
3230
StorageLive(_3); // scope 1 at $DIR/derefer_test.rs:4:22: 4:28
3331
_3 = &mut _1; // scope 1 at $DIR/derefer_test.rs:4:22: 4:28
34-
Deinit(_2); // scope 1 at $DIR/derefer_test.rs:4:17: 4:29
35-
(_2.0: i32) = const 99_i32; // scope 1 at $DIR/derefer_test.rs:4:17: 4:29
36-
(_2.1: &mut (i32, i32)) = move _3; // scope 1 at $DIR/derefer_test.rs:4:17: 4:29
32+
_2 = (const 99_i32, move _3); // scope 1 at $DIR/derefer_test.rs:4:17: 4:29
3733
StorageDead(_3); // scope 1 at $DIR/derefer_test.rs:4:28: 4:29
3834
StorageLive(_4); // scope 2 at $DIR/derefer_test.rs:5:9: 5:10
3935
- _4 = &mut ((*(_2.1: &mut (i32, i32))).0: i32); // scope 2 at $DIR/derefer_test.rs:5:13: 5:26
@@ -53,10 +49,10 @@
5349
StorageDead(_2); // scope 1 at $DIR/derefer_test.rs:7:1: 7:2
5450
StorageDead(_1); // scope 0 at $DIR/derefer_test.rs:7:1: 7:2
5551
return; // scope 0 at $DIR/derefer_test.rs:7:2: 7:2
56-
+ }
57-
+
58-
+ bb1 (cleanup): {
59-
+ resume; // scope 0 at $DIR/derefer_test.rs:2:1: 7:2
52+
}
53+
54+
bb1 (cleanup): {
55+
resume; // scope 0 at $DIR/derefer_test.rs:2:1: 7:2
6056
}
6157
}
6258

src/test/mir-opt/derefer_test_multiple.main.Derefer.diff

+8-16
Original file line numberDiff line numberDiff line change
@@ -39,29 +39,21 @@
3939

4040
bb0: {
4141
StorageLive(_1); // scope 0 at $DIR/derefer_test_multiple.rs:3:9: 3:14
42-
Deinit(_1); // scope 0 at $DIR/derefer_test_multiple.rs:3:17: 3:25
43-
(_1.0: i32) = const 42_i32; // scope 0 at $DIR/derefer_test_multiple.rs:3:17: 3:25
44-
(_1.1: i32) = const 43_i32; // scope 0 at $DIR/derefer_test_multiple.rs:3:17: 3:25
42+
_1 = (const 42_i32, const 43_i32); // scope 0 at $DIR/derefer_test_multiple.rs:3:17: 3:25
4543
StorageLive(_2); // scope 1 at $DIR/derefer_test_multiple.rs:4:9: 4:14
4644
StorageLive(_3); // scope 1 at $DIR/derefer_test_multiple.rs:4:22: 4:28
4745
_3 = &mut _1; // scope 1 at $DIR/derefer_test_multiple.rs:4:22: 4:28
48-
Deinit(_2); // scope 1 at $DIR/derefer_test_multiple.rs:4:17: 4:29
49-
(_2.0: i32) = const 99_i32; // scope 1 at $DIR/derefer_test_multiple.rs:4:17: 4:29
50-
(_2.1: &mut (i32, i32)) = move _3; // scope 1 at $DIR/derefer_test_multiple.rs:4:17: 4:29
46+
_2 = (const 99_i32, move _3); // scope 1 at $DIR/derefer_test_multiple.rs:4:17: 4:29
5147
StorageDead(_3); // scope 1 at $DIR/derefer_test_multiple.rs:4:28: 4:29
5248
StorageLive(_4); // scope 2 at $DIR/derefer_test_multiple.rs:5:9: 5:14
5349
StorageLive(_5); // scope 2 at $DIR/derefer_test_multiple.rs:5:22: 5:28
5450
_5 = &mut _2; // scope 2 at $DIR/derefer_test_multiple.rs:5:22: 5:28
55-
Deinit(_4); // scope 2 at $DIR/derefer_test_multiple.rs:5:17: 5:29
56-
(_4.0: i32) = const 11_i32; // scope 2 at $DIR/derefer_test_multiple.rs:5:17: 5:29
57-
(_4.1: &mut (i32, &mut (i32, i32))) = move _5; // scope 2 at $DIR/derefer_test_multiple.rs:5:17: 5:29
51+
_4 = (const 11_i32, move _5); // scope 2 at $DIR/derefer_test_multiple.rs:5:17: 5:29
5852
StorageDead(_5); // scope 2 at $DIR/derefer_test_multiple.rs:5:28: 5:29
5953
StorageLive(_6); // scope 3 at $DIR/derefer_test_multiple.rs:6:9: 6:14
6054
StorageLive(_7); // scope 3 at $DIR/derefer_test_multiple.rs:6:22: 6:28
6155
_7 = &mut _4; // scope 3 at $DIR/derefer_test_multiple.rs:6:22: 6:28
62-
Deinit(_6); // scope 3 at $DIR/derefer_test_multiple.rs:6:17: 6:29
63-
(_6.0: i32) = const 13_i32; // scope 3 at $DIR/derefer_test_multiple.rs:6:17: 6:29
64-
(_6.1: &mut (i32, &mut (i32, &mut (i32, i32)))) = move _7; // scope 3 at $DIR/derefer_test_multiple.rs:6:17: 6:29
56+
_6 = (const 13_i32, move _7); // scope 3 at $DIR/derefer_test_multiple.rs:6:17: 6:29
6557
StorageDead(_7); // scope 3 at $DIR/derefer_test_multiple.rs:6:28: 6:29
6658
StorageLive(_8); // scope 4 at $DIR/derefer_test_multiple.rs:7:9: 7:10
6759
- _8 = &mut ((*((*((*(_6.1: &mut (i32, &mut (i32, &mut (i32, i32))))).1: &mut (i32, &mut (i32, i32)))).1: &mut (i32, i32))).1: i32); // scope 4 at $DIR/derefer_test_multiple.rs:7:13: 7:30
@@ -95,10 +87,10 @@
9587
StorageDead(_2); // scope 1 at $DIR/derefer_test_multiple.rs:9:1: 9:2
9688
StorageDead(_1); // scope 0 at $DIR/derefer_test_multiple.rs:9:1: 9:2
9789
return; // scope 0 at $DIR/derefer_test_multiple.rs:9:2: 9:2
98-
+ }
99-
+
100-
+ bb1 (cleanup): {
101-
+ resume; // scope 0 at $DIR/derefer_test_multiple.rs:2:1: 9:2
90+
}
91+
92+
bb1 (cleanup): {
93+
resume; // scope 0 at $DIR/derefer_test_multiple.rs:2:1: 9:2
10294
}
10395
}
10496

src/test/mir-opt/early_otherwise_branch.opt1.EarlyOtherwiseBranch.diff

+2-4
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,8 @@
6868
+ bb3: {
6969
StorageDead(_3); // scope 0 at $DIR/early_otherwise_branch.rs:8:1: 8:2
7070
return; // scope 0 at $DIR/early_otherwise_branch.rs:8:2: 8:2
71-
}
72-
73-
- bb5 (cleanup): {
74-
- resume; // scope 0 at $DIR/early_otherwise_branch.rs:3:1: 8:2
71+
+ }
72+
+
7573
+ bb4: {
7674
+ StorageDead(_11); // scope 0 at $DIR/early_otherwise_branch.rs:4:5: 4:17
7775
+ switchInt(_7) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:4:5: 4:17

src/test/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff

+2-4
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,8 @@
8282
+ bb4: {
8383
StorageDead(_3); // scope 0 at $DIR/early_otherwise_branch.rs:17:1: 17:2
8484
return; // scope 0 at $DIR/early_otherwise_branch.rs:17:2: 17:2
85-
}
86-
87-
- bb7 (cleanup): {
88-
- resume; // scope 0 at $DIR/early_otherwise_branch.rs:11:1: 17:2
85+
+ }
86+
+
8987
+ bb5: {
9088
+ StorageDead(_12); // scope 0 at $DIR/early_otherwise_branch.rs:12:5: 12:17
9189
+ switchInt(_8) -> [0_isize: bb3, 1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:12:5: 12:17

src/test/mir-opt/early_otherwise_branch.opt3.EarlyOtherwiseBranch.diff

+2-4
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,8 @@
6868
+ bb3: {
6969
StorageDead(_3); // scope 0 at $DIR/early_otherwise_branch.rs:26:1: 26:2
7070
return; // scope 0 at $DIR/early_otherwise_branch.rs:26:2: 26:2
71-
}
72-
73-
- bb5 (cleanup): {
74-
- resume; // scope 0 at $DIR/early_otherwise_branch.rs:21:1: 26:2
71+
+ }
72+
+
7573
+ bb4: {
7674
+ StorageDead(_11); // scope 0 at $DIR/early_otherwise_branch.rs:22:5: 22:17
7775
+ switchInt(_7) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:22:5: 22:17

src/test/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff

+2-4
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,8 @@
9090
+ bb4: {
9191
StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:9:1: 9:2
9292
return; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:9:2: 9:2
93-
}
94-
95-
- bb6 (cleanup): {
96-
- resume; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:4:1: 9:2
93+
+ }
94+
+
9795
+ bb5: {
9896
+ StorageDead(_15); // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:5:5: 5:20
9997
+ switchInt(_10) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch_3_element_tuple.rs:5:5: 5:20

src/test/mir-opt/early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff

-4
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,5 @@
9191
StorageDead(_3); // scope 0 at $DIR/early_otherwise_branch_noopt.rs:14:1: 14:2
9292
return; // scope 0 at $DIR/early_otherwise_branch_noopt.rs:14:2: 14:2
9393
}
94-
95-
bb9 (cleanup): {
96-
resume; // scope 0 at $DIR/early_otherwise_branch_noopt.rs:7:1: 14:2
97-
}
9894
}
9995

src/test/mir-opt/early_otherwise_branch_soundness.no_deref_ptr.EarlyOtherwiseBranch.diff

-4
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,5 @@
4343
bb5: {
4444
return; // scope 0 at $DIR/early_otherwise_branch_soundness.rs:27:2: 27:2
4545
}
46-
47-
bb6 (cleanup): {
48-
resume; // scope 0 at $DIR/early_otherwise_branch_soundness.rs:18:1: 27:2
49-
}
5046
}
5147

src/test/mir-opt/early_otherwise_branch_soundness.no_downcast.EarlyOtherwiseBranch.diff

-4
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,5 @@
3434
bb4: {
3535
return; // scope 0 at $DIR/early_otherwise_branch_soundness.rs:14:2: 14:2
3636
}
37-
38-
bb5 (cleanup): {
39-
resume; // scope 0 at $DIR/early_otherwise_branch_soundness.rs:12:1: 14:2
40-
}
4137
}
4238

src/test/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff

-4
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,5 @@
2626
StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:17:25: 17:26
2727
return; // scope 0 at $DIR/if-condition-int.rs:18:2: 18:2
2828
}
29-
30-
bb4 (cleanup): {
31-
resume; // scope 0 at $DIR/if-condition-int.rs:16:1: 18:2
32-
}
3329
}
3430

src/test/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff

-4
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,5 @@
3030
StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:53:34: 53:35
3131
return; // scope 0 at $DIR/if-condition-int.rs:54:2: 54:2
3232
}
33-
34-
bb4 (cleanup): {
35-
resume; // scope 0 at $DIR/if-condition-int.rs:52:1: 54:2
36-
}
3733
}
3834

src/test/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff

-4
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,5 @@
5454
StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:49:1: 49:2
5555
return; // scope 0 at $DIR/if-condition-int.rs:49:2: 49:2
5656
}
57-
58-
bb4 (cleanup): {
59-
resume; // scope 0 at $DIR/if-condition-int.rs:43:1: 49:2
60-
}
6157
}
6258

src/test/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff

-4
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,5 @@
3535
StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:21:32: 21:33
3636
return; // scope 0 at $DIR/if-condition-int.rs:22:2: 22:2
3737
}
38-
39-
bb4 (cleanup): {
40-
resume; // scope 0 at $DIR/if-condition-int.rs:20:1: 22:2
41-
}
4238
}
4339

src/test/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff

-4
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,5 @@
3535
StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:25:31: 25:32
3636
return; // scope 0 at $DIR/if-condition-int.rs:26:2: 26:2
3737
}
38-
39-
bb4 (cleanup): {
40-
resume; // scope 0 at $DIR/if-condition-int.rs:24:1: 26:2
41-
}
4238
}
4339

src/test/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff

-4
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,5 @@
6161
StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:39:5: 39:6
6262
return; // scope 0 at $DIR/if-condition-int.rs:40:2: 40:2
6363
}
64-
65-
bb7 (cleanup): {
66-
resume; // scope 0 at $DIR/if-condition-int.rs:32:1: 40:2
67-
}
6864
}
6965

src/test/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff

-4
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,5 @@
3535
StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:29:32: 29:33
3636
return; // scope 0 at $DIR/if-condition-int.rs:30:2: 30:2
3737
}
38-
39-
bb4 (cleanup): {
40-
resume; // scope 0 at $DIR/if-condition-int.rs:28:1: 30:2
41-
}
4238
}
4339

src/test/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff

-4
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,5 @@
3535
StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:12:31: 12:32
3636
return; // scope 0 at $DIR/if-condition-int.rs:13:2: 13:2
3737
}
38-
39-
bb4 (cleanup): {
40-
resume; // scope 0 at $DIR/if-condition-int.rs:11:1: 13:2
41-
}
4238
}
4339

0 commit comments

Comments
 (0)