Skip to content

Commit 8fbab18

Browse files
committedJun 10, 2024
Delete ConstDebugInfo pass
1 parent 476f46a commit 8fbab18

File tree

6 files changed

+36
-125
lines changed

6 files changed

+36
-125
lines changed
 

‎compiler/rustc_mir_transform/src/const_debuginfo.rs

-103
This file was deleted.

‎compiler/rustc_mir_transform/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ mod remove_place_mention;
5555
// This pass is public to allow external drivers to perform MIR cleanup
5656
mod add_subtyping_projections;
5757
pub mod cleanup_post_borrowck;
58-
mod const_debuginfo;
5958
mod copy_prop;
6059
mod coroutine;
6160
mod cost_checker;
@@ -595,7 +594,6 @@ fn run_optimization_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
595594
&simplify::SimplifyLocals::AfterGVN,
596595
&dataflow_const_prop::DataflowConstProp,
597596
&single_use_consts::SingleUseConsts,
598-
&const_debuginfo::ConstDebugInfo,
599597
&o1(simplify_branches::SimplifyConstCondition::AfterConstProp),
600598
&jump_threading::JumpThreading,
601599
&early_otherwise_branch::EarlyOtherwiseBranch,

‎tests/mir-opt/const_debuginfo.main.ConstDebugInfo.diff renamed to ‎tests/mir-opt/const_debuginfo.main.SingleUseConsts.diff

+30-16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
- // MIR for `main` before ConstDebugInfo
2-
+ // MIR for `main` after ConstDebugInfo
1+
- // MIR for `main` before SingleUseConsts
2+
+ // MIR for `main` after SingleUseConsts
33

44
fn main() -> () {
55
let mut _0: ();
@@ -56,39 +56,53 @@
5656

5757
bb0: {
5858
nop;
59-
_1 = const 1_u8;
59+
- _1 = const 1_u8;
6060
nop;
61-
_2 = const 2_u8;
61+
- _2 = const 2_u8;
6262
nop;
63-
_3 = const 3_u8;
63+
- _3 = const 3_u8;
64+
+ nop;
65+
+ nop;
66+
+ nop;
6467
StorageLive(_4);
6568
StorageLive(_5);
6669
StorageLive(_6);
67-
_6 = const 1_u8;
70+
- _6 = const 1_u8;
71+
+ nop;
6872
StorageLive(_7);
69-
_7 = const 2_u8;
70-
_5 = const 3_u8;
73+
- _7 = const 2_u8;
74+
- _5 = const 3_u8;
75+
+ nop;
76+
+ nop;
7177
StorageDead(_7);
7278
StorageDead(_6);
7379
StorageLive(_8);
74-
_8 = const 3_u8;
75-
_4 = const 6_u8;
80+
- _8 = const 3_u8;
81+
- _4 = const 6_u8;
82+
+ nop;
83+
+ nop;
7684
StorageDead(_8);
7785
StorageDead(_5);
7886
StorageLive(_9);
79-
_9 = const "hello, world!";
87+
- _9 = const "hello, world!";
88+
+ nop;
8089
StorageLive(_10);
8190
_10 = (const true, const false, const 123_u32);
8291
StorageLive(_11);
83-
_11 = const Option::<u16>::Some(99_u16);
92+
- _11 = const Option::<u16>::Some(99_u16);
93+
+ nop;
8494
StorageLive(_12);
85-
_12 = const Point {{ x: 32_u32, y: 32_u32 }};
95+
- _12 = const Point {{ x: 32_u32, y: 32_u32 }};
96+
+ nop;
8697
StorageLive(_13);
8798
nop;
88-
_14 = const 32_u32;
99+
- _14 = const 32_u32;
100+
+ nop;
89101
StorageLive(_15);
90-
_15 = const 32_u32;
91-
_13 = const 64_u32;
102+
- _15 = const 32_u32;
103+
- _13 = const 64_u32;
104+
+ nop;
105+
+ nop;
92106
StorageDead(_15);
93107
nop;
94108
_0 = const ();

‎tests/mir-opt/const_debuginfo.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
//@ test-mir-pass: ConstDebugInfo
1+
//@ test-mir-pass: SingleUseConsts
22
//@ compile-flags: -C overflow-checks=no -Zmir-enable-passes=+GVN
33

4+
#![allow(unused)]
5+
46
struct Point {
57
x: u32,
68
y: u32,
79
}
810

9-
// EMIT_MIR const_debuginfo.main.ConstDebugInfo.diff
11+
// EMIT_MIR const_debuginfo.main.SingleUseConsts.diff
1012
fn main() {
1113
// CHECK-LABEL: fn main(
1214
// CHECK: debug x => const 1_u8;

‎tests/mir-opt/inline/issue_106141.outer.Inline.panic-abort.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
+ let mut _2: bool;
99
+ let mut _3: bool;
1010
+ scope 2 {
11-
+ debug buffer => const inner::promoted[0];
11+
+ debug buffer => _1;
1212
+ scope 3 {
1313
+ debug index => _0;
1414
+ }

‎tests/mir-opt/inline/issue_106141.outer.Inline.panic-unwind.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
+ let mut _2: bool;
99
+ let mut _3: bool;
1010
+ scope 2 {
11-
+ debug buffer => const inner::promoted[0];
11+
+ debug buffer => _1;
1212
+ scope 3 {
1313
+ debug index => _0;
1414
+ }

0 commit comments

Comments
 (0)