Rollup merge of #122656 - RalfJung:simplify-cfg, r=compiler-errors
simplify_cfg: rename some passes so that they make more sense I was extremely confused by `SimplifyCfg::ElaborateDrops`, since it runs way later than drop elaboration. It is used e.g. in `mir-opt/retag.rs` even though that pass doesn't care about drop elaboration at all. "Early opt" is also very confusing since that makes it sounds like it runs early during optimizations, i.e. on runtime MIR, but actually it runs way before that. So I decided to rename - early-opt -> post-analysis - elaborate-drops -> pre-optimizations I am open to other suggestions.
This commit is contained in:
commit
3fc3142df1
29 changed files with 43 additions and 40 deletions
|
@ -507,7 +507,7 @@ fn run_analysis_cleanup_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
|
|||
let passes: &[&dyn MirPass<'tcx>] = &[
|
||||
&cleanup_post_borrowck::CleanupPostBorrowck,
|
||||
&remove_noop_landing_pads::RemoveNoopLandingPads,
|
||||
&simplify::SimplifyCfg::EarlyOpt,
|
||||
&simplify::SimplifyCfg::PostAnalysis,
|
||||
&deref_separator::Derefer,
|
||||
];
|
||||
|
||||
|
@ -544,7 +544,7 @@ fn run_runtime_cleanup_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
|
|||
let passes: &[&dyn MirPass<'tcx>] = &[
|
||||
&lower_intrinsics::LowerIntrinsics,
|
||||
&remove_place_mention::RemovePlaceMention,
|
||||
&simplify::SimplifyCfg::ElaborateDrops,
|
||||
&simplify::SimplifyCfg::PreOptimizations,
|
||||
];
|
||||
|
||||
pm::run_passes(tcx, body, passes, Some(MirPhase::Runtime(RuntimePhase::PostCleanup)));
|
||||
|
|
|
@ -37,8 +37,11 @@ pub enum SimplifyCfg {
|
|||
Initial,
|
||||
PromoteConsts,
|
||||
RemoveFalseEdges,
|
||||
EarlyOpt,
|
||||
ElaborateDrops,
|
||||
/// Runs at the beginning of "analysis to runtime" lowering, *before* drop elaboration.
|
||||
PostAnalysis,
|
||||
/// Runs at the end of "analysis to runtime" lowering, *after* drop elaboration.
|
||||
/// This is before the main optimization passes on runtime MIR kick in.
|
||||
PreOptimizations,
|
||||
Final,
|
||||
MakeShim,
|
||||
AfterUninhabitedEnumBranching,
|
||||
|
@ -50,8 +53,8 @@ impl SimplifyCfg {
|
|||
SimplifyCfg::Initial => "SimplifyCfg-initial",
|
||||
SimplifyCfg::PromoteConsts => "SimplifyCfg-promote-consts",
|
||||
SimplifyCfg::RemoveFalseEdges => "SimplifyCfg-remove-false-edges",
|
||||
SimplifyCfg::EarlyOpt => "SimplifyCfg-early-opt",
|
||||
SimplifyCfg::ElaborateDrops => "SimplifyCfg-elaborate-drops",
|
||||
SimplifyCfg::PostAnalysis => "SimplifyCfg-post-analysis",
|
||||
SimplifyCfg::PreOptimizations => "SimplifyCfg-pre-optimizations",
|
||||
SimplifyCfg::Final => "SimplifyCfg-final",
|
||||
SimplifyCfg::MakeShim => "SimplifyCfg-make_shim",
|
||||
SimplifyCfg::AfterUninhabitedEnumBranching => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue