Commit 139acaac by Ben Clayton

VkPipeline: Add spirvopt MergeReturnPass

Fixes cases where functions were not being inlined. Tests: dEQP-VK.glsl.functions.control_flow.* Change-Id: Ia752517040f7529ec3b47adc75ec03646d183f6d Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/30214Tested-by: 's avatarBen Clayton <bclayton@google.com> Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 05f27a34
......@@ -174,6 +174,9 @@ std::vector<uint32_t> preprocessSpirv(
vk::trace("%s: %d:%d %s", category, int(p.line), int(p.column), m);
});
opt.RegisterPass(spvtools::CreateDeadBranchElimPass()); // Required for MergeReturnPass
opt.RegisterPass(spvtools::CreateMergeReturnPass());
opt.RegisterPass(spvtools::CreateInlineExhaustivePass());
opt.RegisterPass(spvtools::CreateEliminateDeadFunctionsPass());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment