mirror of
https://github.com/openharmony/third_party_spirv-tools.git
synced 2026-07-18 13:15:19 -04:00
Adding additional functionality to ADCE.
Modified ADCE to remove dead globals. * Entry point and execution mode instructions are marked as alive * Reachable functions and their parameters are marked as alive * Instruction deletion now deferred until the end of the pass * Eliminated dead insts set, added IsDead to calculate that value instead * Ported applicable dead variable elimination tests * Ported dead constant elim tests Added dead function elimination to ADCE * ported dead function elim tests Added handling of decoration groups in ADCE * Uses a custom sorter to traverse decorations in a specific order * Simplifies necessary checks Updated -O and -Os pass lists.
This commit is contained in:
@@ -118,7 +118,7 @@ Optimizer& Optimizer::RegisterPerformancePasses() {
|
||||
return RegisterPass(CreateRemoveDuplicatesPass())
|
||||
.RegisterPass(CreateMergeReturnPass())
|
||||
.RegisterPass(CreateInlineExhaustivePass())
|
||||
.RegisterPass(CreateEliminateDeadFunctionsPass())
|
||||
.RegisterPass(CreateAggressiveDCEPass())
|
||||
.RegisterPass(CreateScalarReplacementPass())
|
||||
.RegisterPass(CreateLocalAccessChainConvertPass())
|
||||
.RegisterPass(CreateLocalSingleBlockLoadStoreElimPass())
|
||||
@@ -134,14 +134,14 @@ Optimizer& Optimizer::RegisterPerformancePasses() {
|
||||
.RegisterPass(CreateCFGCleanupPass())
|
||||
// Currently exposing driver bugs resulting in crashes (#946)
|
||||
// .RegisterPass(CreateCommonUniformElimPass())
|
||||
.RegisterPass(CreateDeadVariableEliminationPass());
|
||||
.RegisterPass(CreateAggressiveDCEPass());
|
||||
}
|
||||
|
||||
Optimizer& Optimizer::RegisterSizePasses() {
|
||||
return RegisterPass(CreateRemoveDuplicatesPass())
|
||||
.RegisterPass(CreateMergeReturnPass())
|
||||
.RegisterPass(CreateInlineExhaustivePass())
|
||||
.RegisterPass(CreateEliminateDeadFunctionsPass())
|
||||
.RegisterPass(CreateAggressiveDCEPass())
|
||||
.RegisterPass(CreateLocalAccessChainConvertPass())
|
||||
.RegisterPass(CreateLocalSingleBlockLoadStoreElimPass())
|
||||
.RegisterPass(CreateLocalSingleStoreElimPass())
|
||||
@@ -156,7 +156,7 @@ Optimizer& Optimizer::RegisterSizePasses() {
|
||||
.RegisterPass(CreateCFGCleanupPass())
|
||||
// Currently exposing driver bugs resulting in crashes (#946)
|
||||
// .RegisterPass(CreateCommonUniformElimPass())
|
||||
.RegisterPass(CreateDeadVariableEliminationPass());
|
||||
.RegisterPass(CreateAggressiveDCEPass());
|
||||
}
|
||||
|
||||
bool Optimizer::Run(const uint32_t* original_binary,
|
||||
|
||||
Reference in New Issue
Block a user