diff options
| author | dianqk <dianqk@dianqk.net> | 2025-04-21 21:46:35 +0800 |
|---|---|---|
| committer | dianqk <dianqk@dianqk.net> | 2025-04-21 21:46:44 +0800 |
| commit | 5881b7c68b353c3723133c43f209802b3a0c9621 (patch) | |
| tree | cd9a9b2df1164df10b21b4f464532738b025b1e2 /compiler/rustc_mir_transform/src/lib.rs | |
| parent | b8005bff3248cfc6e327faf4fa631ac49bb49ba9 (diff) | |
| download | rust-5881b7c68b353c3723133c43f209802b3a0c9621.tar.gz rust-5881b7c68b353c3723133c43f209802b3a0c9621.zip | |
mir-opt: execute MatchBranchSimplification after GVN
This can provide more opportunities for MatchBranchSimplification.
Diffstat (limited to 'compiler/rustc_mir_transform/src/lib.rs')
| -rw-r--r-- | compiler/rustc_mir_transform/src/lib.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_mir_transform/src/lib.rs b/compiler/rustc_mir_transform/src/lib.rs index 4d74ecddfb0..8b81f0e6179 100644 --- a/compiler/rustc_mir_transform/src/lib.rs +++ b/compiler/rustc_mir_transform/src/lib.rs @@ -699,8 +699,6 @@ fn run_optimization_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { // Now, we need to shrink the generated MIR. &ref_prop::ReferencePropagation, &sroa::ScalarReplacementOfAggregates, - &match_branches::MatchBranchSimplification, - // inst combine is after MatchBranchSimplification to clean up Ne(_1, false) &multiple_return_terminators::MultipleReturnTerminators, // After simplifycfg, it allows us to discover new opportunities for peephole // optimizations. @@ -709,6 +707,7 @@ fn run_optimization_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { &dead_store_elimination::DeadStoreElimination::Initial, &gvn::GVN, &simplify::SimplifyLocals::AfterGVN, + &match_branches::MatchBranchSimplification, &dataflow_const_prop::DataflowConstProp, &single_use_consts::SingleUseConsts, &o1(simplify_branches::SimplifyConstCondition::AfterConstProp), |
