Perform instsimplify before inline to eliminate some trivial calls
This commit is contained in:
@@ -571,6 +571,8 @@ fn run_optimization_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
|
||||
// Has to be done before inlining, otherwise actual call will be almost always inlined.
|
||||
// Also simple, so can just do first
|
||||
&lower_slice_len::LowerSliceLenCalls,
|
||||
// Perform instsimplify before inline to eliminate some trivial calls (like clone shims).
|
||||
&instsimplify::InstSimplify::BeforeInline,
|
||||
// Perform inlining, which may add a lot of code.
|
||||
&inline::Inline,
|
||||
// Code from other crates may have storage markers, so this needs to happen after inlining.
|
||||
@@ -590,7 +592,8 @@ fn run_optimization_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
|
||||
&match_branches::MatchBranchSimplification,
|
||||
// inst combine is after MatchBranchSimplification to clean up Ne(_1, false)
|
||||
&multiple_return_terminators::MultipleReturnTerminators,
|
||||
&instsimplify::InstSimplify,
|
||||
// After simplifycfg, it allows us to discover new opportunities for peephole optimizations.
|
||||
&instsimplify::InstSimplify::AfterSimplifyCfg,
|
||||
&simplify::SimplifyLocals::BeforeConstProp,
|
||||
&dead_store_elimination::DeadStoreElimination::Initial,
|
||||
&gvn::GVN,
|
||||
|
||||
Reference in New Issue
Block a user