Add DeadBranchElim before MergeReturn in legalization.

MergeReturn now requires this or could throw an error.
This commit is contained in:
GregF 2018-11-08 10:35:45 -07:00
parent 4207c97b93
commit 68fbda9862

View File

@ -152,6 +152,7 @@ void SpirvToolsLegalize(const glslang::TIntermediate&, std::vector<unsigned int>
out << std::endl;
});
optimizer.RegisterPass(spvtools::CreateDeadBranchElimPass());
optimizer.RegisterPass(spvtools::CreateMergeReturnPass());
optimizer.RegisterPass(spvtools::CreateInlineExhaustivePass());
optimizer.RegisterPass(spvtools::CreateEliminateDeadFunctionsPass());