Perform reference propagation earlier.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user