diff options
| author | 2021-02-14 20:15:42 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:22 -0400 | |
| commit | cbfb7d182a4e90e4e263696d1fca35e47d3eabb4 (patch) | |
| tree | a8d384aa0daefdfafd9b61330e06b1cf7ac40ea6 /src/shader_recompiler/ir_opt/passes.h | |
| parent | shader: Misc fixes (diff) | |
| download | yuzu-cbfb7d182a4e90e4e263696d1fca35e47d3eabb4.tar.gz yuzu-cbfb7d182a4e90e4e263696d1fca35e47d3eabb4.tar.xz yuzu-cbfb7d182a4e90e4e263696d1fca35e47d3eabb4.zip | |
shader: Support SSA loops on IR
Diffstat (limited to 'src/shader_recompiler/ir_opt/passes.h')
| -rw-r--r-- | src/shader_recompiler/ir_opt/passes.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/shader_recompiler/ir_opt/passes.h b/src/shader_recompiler/ir_opt/passes.h index 578a24d89..30eb31588 100644 --- a/src/shader_recompiler/ir_opt/passes.h +++ b/src/shader_recompiler/ir_opt/passes.h | |||
| @@ -4,14 +4,16 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <span> | ||
| 8 | |||
| 7 | #include "shader_recompiler/frontend/ir/basic_block.h" | 9 | #include "shader_recompiler/frontend/ir/basic_block.h" |
| 8 | #include "shader_recompiler/frontend/ir/function.h" | 10 | #include "shader_recompiler/frontend/ir/function.h" |
| 9 | 11 | ||
| 10 | namespace Shader::Optimization { | 12 | namespace Shader::Optimization { |
| 11 | 13 | ||
| 12 | template <typename Func> | 14 | template <typename Func> |
| 13 | void Invoke(Func&& func, IR::Function& function) { | 15 | void PostOrderInvoke(Func&& func, IR::Function& function) { |
| 14 | for (const auto& block : function.blocks) { | 16 | for (const auto& block : function.post_order_blocks) { |
| 15 | func(*block); | 17 | func(*block); |
| 16 | } | 18 | } |
| 17 | } | 19 | } |
| @@ -20,7 +22,7 @@ void ConstantPropagationPass(IR::Block& block); | |||
| 20 | void DeadCodeEliminationPass(IR::Block& block); | 22 | void DeadCodeEliminationPass(IR::Block& block); |
| 21 | void GlobalMemoryToStorageBufferPass(IR::Block& block); | 23 | void GlobalMemoryToStorageBufferPass(IR::Block& block); |
| 22 | void IdentityRemovalPass(IR::Function& function); | 24 | void IdentityRemovalPass(IR::Function& function); |
| 23 | void SsaRewritePass(IR::Function& function); | 25 | void SsaRewritePass(std::span<IR::Block* const> post_order_blocks); |
| 24 | void VerificationPass(const IR::Function& function); | 26 | void VerificationPass(const IR::Function& function); |
| 25 | 27 | ||
| 26 | } // namespace Shader::Optimization | 28 | } // namespace Shader::Optimization |