Improve RegisterSizePasses (#3059)

This commit is contained in:
greg-lunarg 2019-11-27 07:41:50 -07:00 committed by Steven Perron
parent f31f26f739
commit 868ca3954c
2 changed files with 43 additions and 29 deletions

View File

@ -198,28 +198,35 @@ Optimizer& Optimizer::RegisterSizePasses() {
.RegisterPass(CreateDeadBranchElimPass()) .RegisterPass(CreateDeadBranchElimPass())
.RegisterPass(CreateMergeReturnPass()) .RegisterPass(CreateMergeReturnPass())
.RegisterPass(CreateInlineExhaustivePass()) .RegisterPass(CreateInlineExhaustivePass())
.RegisterPass(CreateAggressiveDCEPass()) .RegisterPass(CreateEliminateDeadFunctionsPass())
.RegisterPass(CreatePrivateToLocalPass()) .RegisterPass(CreatePrivateToLocalPass())
.RegisterPass(CreateScalarReplacementPass()) .RegisterPass(CreateScalarReplacementPass(0))
.RegisterPass(CreateLocalAccessChainConvertPass())
.RegisterPass(CreateLocalSingleBlockLoadStoreElimPass())
.RegisterPass(CreateLocalSingleStoreElimPass())
.RegisterPass(CreateAggressiveDCEPass())
.RegisterPass(CreateSimplificationPass())
.RegisterPass(CreateDeadInsertElimPass())
.RegisterPass(CreateLocalMultiStoreElimPass()) .RegisterPass(CreateLocalMultiStoreElimPass())
.RegisterPass(CreateAggressiveDCEPass())
.RegisterPass(CreateCCPPass()) .RegisterPass(CreateCCPPass())
.RegisterPass(CreateLoopUnrollPass(true))
.RegisterPass(CreateDeadBranchElimPass())
.RegisterPass(CreateSimplificationPass())
.RegisterPass(CreateScalarReplacementPass(0))
.RegisterPass(CreateLocalSingleStoreElimPass())
.RegisterPass(CreateIfConversionPass())
.RegisterPass(CreateSimplificationPass())
.RegisterPass(CreateAggressiveDCEPass()) .RegisterPass(CreateAggressiveDCEPass())
.RegisterPass(CreateDeadBranchElimPass()) .RegisterPass(CreateDeadBranchElimPass())
.RegisterPass(CreateIfConversionPass())
.RegisterPass(CreateAggressiveDCEPass())
.RegisterPass(CreateBlockMergePass()) .RegisterPass(CreateBlockMergePass())
.RegisterPass(CreateSimplificationPass()) .RegisterPass(CreateLocalAccessChainConvertPass())
.RegisterPass(CreateLocalSingleBlockLoadStoreElimPass())
.RegisterPass(CreateAggressiveDCEPass())
.RegisterPass(CreateCopyPropagateArraysPass())
.RegisterPass(CreateVectorDCEPass())
.RegisterPass(CreateDeadInsertElimPass()) .RegisterPass(CreateDeadInsertElimPass())
.RegisterPass(CreateEliminateDeadMembersPass())
.RegisterPass(CreateLocalSingleStoreElimPass())
.RegisterPass(CreateBlockMergePass())
.RegisterPass(CreateLocalMultiStoreElimPass())
.RegisterPass(CreateRedundancyEliminationPass()) .RegisterPass(CreateRedundancyEliminationPass())
.RegisterPass(CreateCFGCleanupPass()) .RegisterPass(CreateSimplificationPass())
.RegisterPass(CreateAggressiveDCEPass()); .RegisterPass(CreateAggressiveDCEPass())
.RegisterPass(CreateCFGCleanupPass());
} }
Optimizer& Optimizer::RegisterVulkanToWebGPUPasses() { Optimizer& Optimizer::RegisterVulkanToWebGPUPasses() {

View File

@ -187,28 +187,35 @@ class TestSizeOptimizationPasses(expect.ValidObjectFile1_5,
'eliminate-dead-branches', 'eliminate-dead-branches',
'merge-return', 'merge-return',
'inline-entry-points-exhaustive', 'inline-entry-points-exhaustive',
'eliminate-dead-code-aggressive', 'eliminate-dead-functions',
'private-to-local', 'private-to-local',
'scalar-replacement=100', 'scalar-replacement=0',
'convert-local-access-chains',
'eliminate-local-single-block',
'eliminate-local-single-store',
'eliminate-dead-code-aggressive',
'simplify-instructions',
'eliminate-dead-inserts',
'ssa-rewrite', 'ssa-rewrite',
'eliminate-dead-code-aggressive',
'ccp', 'ccp',
'loop-unroll',
'eliminate-dead-branches',
'simplify-instructions',
'scalar-replacement=0',
'eliminate-local-single-store',
'if-conversion',
'simplify-instructions',
'eliminate-dead-code-aggressive', 'eliminate-dead-code-aggressive',
'eliminate-dead-branches', 'eliminate-dead-branches',
'if-conversion',
'eliminate-dead-code-aggressive',
'merge-blocks', 'merge-blocks',
'simplify-instructions', 'convert-local-access-chains',
'eliminate-dead-inserts', 'eliminate-local-single-block',
'redundancy-elimination',
'cfg-cleanup',
'eliminate-dead-code-aggressive', 'eliminate-dead-code-aggressive',
'copy-propagate-arrays',
'vector-dce',
'eliminate-dead-inserts',
'eliminate-dead-members',
'eliminate-local-single-store',
'merge-blocks',
'ssa-rewrite',
'redundancy-elimination',
'simplify-instructions',
'eliminate-dead-code-aggressive',
'cfg-cleanup',
] ]
shader = placeholder.FileSPIRVShader(empty_main_assembly(), '.spvasm') shader = placeholder.FileSPIRVShader(empty_main_assembly(), '.spvasm')
output = placeholder.TempFileName('output.spv') output = placeholder.TempFileName('output.spv')