diff options
| author | 2021-02-02 21:07:00 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:21 -0400 | |
| commit | 6c4cc0cd062fbbba5349da1108d3c23cb330ca8a (patch) | |
| tree | 544291931da8a85fafcea71964c77d9278ec7f29 /src/shader_recompiler/ir_opt/passes.h | |
| parent | shader: Initial recompiler work (diff) | |
| download | yuzu-6c4cc0cd062fbbba5349da1108d3c23cb330ca8a.tar.gz yuzu-6c4cc0cd062fbbba5349da1108d3c23cb330ca8a.tar.xz yuzu-6c4cc0cd062fbbba5349da1108d3c23cb330ca8a.zip | |
shader: SSA and dominance
Diffstat (limited to 'src/shader_recompiler/ir_opt/passes.h')
| -rw-r--r-- | src/shader_recompiler/ir_opt/passes.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/shader_recompiler/ir_opt/passes.h b/src/shader_recompiler/ir_opt/passes.h index fe5454e9a..83f094d73 100644 --- a/src/shader_recompiler/ir_opt/passes.h +++ b/src/shader_recompiler/ir_opt/passes.h | |||
| @@ -5,12 +5,21 @@ | |||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include "shader_recompiler/frontend/ir/basic_block.h" | 7 | #include "shader_recompiler/frontend/ir/basic_block.h" |
| 8 | #include "shader_recompiler/frontend/ir/function.h" | ||
| 8 | 9 | ||
| 9 | namespace Shader::Optimization { | 10 | namespace Shader::Optimization { |
| 10 | 11 | ||
| 12 | template <typename Func> | ||
| 13 | void Invoke(Func&& func, IR::Function& function) { | ||
| 14 | for (const auto& block : function.blocks) { | ||
| 15 | func(*block); | ||
| 16 | } | ||
| 17 | } | ||
| 18 | |||
| 11 | void DeadCodeEliminationPass(IR::Block& block); | 19 | void DeadCodeEliminationPass(IR::Block& block); |
| 12 | void GetSetElimination(IR::Block& block); | 20 | void GetSetElimination(IR::Block& block); |
| 13 | void IdentityRemovalPass(IR::Block& block); | 21 | void IdentityRemovalPass(IR::Block& block); |
| 22 | void SsaRewritePass(IR::Function& function); | ||
| 14 | void VerificationPass(const IR::Block& block); | 23 | void VerificationPass(const IR::Block& block); |
| 15 | 24 | ||
| 16 | } // namespace Shader::Optimization | 25 | } // namespace Shader::Optimization |