Add dead function elimination to -O (#4015)

Fixes #4003

Both legalization and size formulae already run dead function
elimination after inlining. This change does the same for performance
passes.
This commit is contained in:
alan-baker 2020-11-05 13:03:45 -05:00 committed by GitHub
parent c2b2b57885
commit 0c036df288
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -161,6 +161,7 @@ Optimizer& Optimizer::RegisterPerformancePasses() {
.RegisterPass(CreateDeadBranchElimPass()) .RegisterPass(CreateDeadBranchElimPass())
.RegisterPass(CreateMergeReturnPass()) .RegisterPass(CreateMergeReturnPass())
.RegisterPass(CreateInlineExhaustivePass()) .RegisterPass(CreateInlineExhaustivePass())
.RegisterPass(CreateEliminateDeadFunctionsPass())
.RegisterPass(CreateAggressiveDCEPass()) .RegisterPass(CreateAggressiveDCEPass())
.RegisterPass(CreatePrivateToLocalPass()) .RegisterPass(CreatePrivateToLocalPass())
.RegisterPass(CreateLocalSingleBlockLoadStoreElimPass()) .RegisterPass(CreateLocalSingleBlockLoadStoreElimPass())

View File

@ -149,6 +149,7 @@ class TestPerformanceOptimizationPasses(expect.ValidObjectFile1_5,
'eliminate-dead-branches', 'eliminate-dead-branches',
'merge-return', 'merge-return',
'inline-entry-points-exhaustive', 'inline-entry-points-exhaustive',
'eliminate-dead-functions',
'eliminate-dead-code-aggressive', 'eliminate-dead-code-aggressive',
'private-to-local', 'private-to-local',
'eliminate-local-single-block', 'eliminate-local-single-block',