diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2023-03-12 14:10:30 +0000 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2023-07-10 16:01:18 +0000 |
| commit | 4de2d8fb66e5036af00a7a900c72c6ae00ca2cf4 (patch) | |
| tree | 8b0d62da70eeefb4098f2d6d78d672f13bea61d4 /compiler/rustc_mir_transform/src | |
| parent | b74a144a5fcee833cdcc7ae6c5937f8dbe7f2e80 (diff) | |
| download | rust-4de2d8fb66e5036af00a7a900c72c6ae00ca2cf4.tar.gz rust-4de2d8fb66e5036af00a7a900c72c6ae00ca2cf4.zip | |
Perform reference propagation earlier.
Diffstat (limited to 'compiler/rustc_mir_transform/src')
| -rw-r--r-- | compiler/rustc_mir_transform/src/lib.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_mir_transform/src/lib.rs b/compiler/rustc_mir_transform/src/lib.rs index fa8257cf984..d419329f2d6 100644 --- a/compiler/rustc_mir_transform/src/lib.rs +++ b/compiler/rustc_mir_transform/src/lib.rs @@ -553,6 +553,7 @@ fn run_optimization_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { &normalize_array_len::NormalizeArrayLen, // has to run after `slice::len` lowering &const_goto::ConstGoto, &remove_unneeded_drops::RemoveUnneededDrops, + &ref_prop::ReferencePropagation, &sroa::ScalarReplacementOfAggregates, &match_branches::MatchBranchSimplification, // inst combine is after MatchBranchSimplification to clean up Ne(_1, false) @@ -560,7 +561,6 @@ fn run_optimization_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { &instsimplify::InstSimplify, &simplify::SimplifyLocals::BeforeConstProp, ©_prop::CopyProp, - &ref_prop::ReferencePropagation, // Perform `SeparateConstSwitch` after SSA-based analyses, as cloning blocks may // destroy the SSA property. It should still happen before const-propagation, so the // latter pass will leverage the created opportunities. |
