@@ -296,7 +296,7 @@ fn mir_const(tcx: TyCtxt<'_>, def: ty::WithOptConstParam<LocalDefId>) -> &Steal<
296296 & Lint ( check_const_item_mutation:: CheckConstItemMutation ) ,
297297 & Lint ( function_item_references:: FunctionItemReferences ) ,
298298 // What we need to do constant evaluation.
299- & simplify:: SimplifyCfg :: new ( "initial" ) ,
299+ & simplify:: SimplifyCfg :: Initial ,
300300 & rustc_peek:: SanityCheck , // Just a lint
301301 ] ,
302302 None ,
@@ -334,11 +334,7 @@ fn mir_promoted(
334334 pm:: run_passes (
335335 tcx,
336336 & mut body,
337- & [
338- & promote_pass,
339- & simplify:: SimplifyCfg :: new ( "promote-consts" ) ,
340- & coverage:: InstrumentCoverage ,
341- ] ,
337+ & [ & promote_pass, & simplify:: SimplifyCfg :: PromoteConsts , & coverage:: InstrumentCoverage ] ,
342338 Some ( MirPhase :: Analysis ( AnalysisPhase :: Initial ) ) ,
343339 ) ;
344340
@@ -467,10 +463,7 @@ fn run_analysis_to_runtime_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>
467463 pm:: run_passes (
468464 tcx,
469465 body,
470- & [
471- & remove_uninit_drops:: RemoveUninitDrops ,
472- & simplify:: SimplifyCfg :: new ( "remove-false-edges" ) ,
473- ] ,
466+ & [ & remove_uninit_drops:: RemoveUninitDrops , & simplify:: SimplifyCfg :: RemoveFalseEdges ] ,
474467 None ,
475468 ) ;
476469 check_consts:: post_drop_elaboration:: check_live_drops ( tcx, & body) ; // FIXME: make this a MIR lint
@@ -492,7 +485,7 @@ fn run_analysis_cleanup_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
492485 let passes: & [ & dyn MirPass < ' tcx > ] = & [
493486 & cleanup_post_borrowck:: CleanupPostBorrowck ,
494487 & remove_noop_landing_pads:: RemoveNoopLandingPads ,
495- & simplify:: SimplifyCfg :: new ( "early-opt" ) ,
488+ & simplify:: SimplifyCfg :: EarlyOpt ,
496489 & deref_separator:: Derefer ,
497490 ] ;
498491
@@ -525,7 +518,7 @@ fn run_runtime_lowering_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
525518/// Returns the sequence of passes that do the initial cleanup of runtime MIR.
526519fn run_runtime_cleanup_passes < ' tcx > ( tcx : TyCtxt < ' tcx > , body : & mut Body < ' tcx > ) {
527520 let passes: & [ & dyn MirPass < ' tcx > ] =
528- & [ & lower_intrinsics:: LowerIntrinsics , & simplify:: SimplifyCfg :: new ( "elaborate-drops" ) ] ;
521+ & [ & lower_intrinsics:: LowerIntrinsics , & simplify:: SimplifyCfg :: ElaborateDrops ] ;
529522
530523 pm:: run_passes ( tcx, body, passes, Some ( MirPhase :: Runtime ( RuntimePhase :: PostCleanup ) ) ) ;
531524
@@ -551,7 +544,7 @@ fn run_optimization_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
551544 & lower_slice_len:: LowerSliceLenCalls , // has to be done before inlining, otherwise actual call will be almost always inlined. Also simple, so can just do first
552545 & unreachable_prop:: UnreachablePropagation ,
553546 & uninhabited_enum_branching:: UninhabitedEnumBranching ,
554- & o1 ( simplify:: SimplifyCfg :: new ( "after-uninhabited-enum-branching" ) ) ,
547+ & o1 ( simplify:: SimplifyCfg :: AfterUninhabitedEnumBranching ) ,
555548 & inline:: Inline ,
556549 & remove_storage_markers:: RemoveStorageMarkers ,
557550 & remove_zsts:: RemoveZsts ,
@@ -564,23 +557,23 @@ fn run_optimization_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
564557 & multiple_return_terminators:: MultipleReturnTerminators ,
565558 & instcombine:: InstCombine ,
566559 & separate_const_switch:: SeparateConstSwitch ,
567- & simplify:: SimplifyLocals :: new ( "before-const-prop" ) ,
560+ & simplify:: SimplifyLocals :: BeforeConstProp ,
568561 & copy_prop:: CopyProp ,
569562 & const_prop:: ConstProp ,
570563 & dataflow_const_prop:: DataflowConstProp ,
571564 //
572565 // Const-prop runs unconditionally, but doesn't mutate the MIR at mir-opt-level=0.
573566 & const_debuginfo:: ConstDebugInfo ,
574- & o1 ( simplify_branches:: SimplifyConstCondition :: new ( "after-const-prop" ) ) ,
567+ & o1 ( simplify_branches:: SimplifyConstConditionPassName :: AfterConstProp ) ,
575568 & early_otherwise_branch:: EarlyOtherwiseBranch ,
576569 & simplify_comparison_integral:: SimplifyComparisonIntegral ,
577570 & dead_store_elimination:: DeadStoreElimination ,
578571 & dest_prop:: DestinationPropagation ,
579- & o1 ( simplify_branches:: SimplifyConstCondition :: new ( "final" ) ) ,
572+ & o1 ( simplify_branches:: SimplifyConstConditionPassName :: Final ) ,
580573 & o1 ( remove_noop_landing_pads:: RemoveNoopLandingPads ) ,
581- & o1 ( simplify:: SimplifyCfg :: new ( "final" ) ) ,
574+ & o1 ( simplify:: SimplifyCfg :: Final ) ,
582575 & nrvo:: RenameReturnPlace ,
583- & simplify:: SimplifyLocals :: new ( "final" ) ,
576+ & simplify:: SimplifyLocals :: Final ,
584577 & multiple_return_terminators:: MultipleReturnTerminators ,
585578 & deduplicate_blocks:: DeduplicateBlocks ,
586579 & large_enums:: EnumSizeOpt { discrepancy : 128 } ,
0 commit comments