diff options
| author | 2021-05-14 00:40:54 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:31 -0400 | |
| commit | d54d7de40e7295827b0e4e4026441b53d3fc9569 (patch) | |
| tree | 29b5074f851292dace7aeb5da7716675544b3735 /src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp | |
| parent | glasm: Implement Storage atomics (diff) | |
| download | yuzu-d54d7de40e7295827b0e4e4026441b53d3fc9569.tar.gz yuzu-d54d7de40e7295827b0e4e4026441b53d3fc9569.tar.xz yuzu-d54d7de40e7295827b0e4e4026441b53d3fc9569.zip | |
glasm: Rework control flow introducing a syntax list
This commit regresses VertexA shaders, their transformation pass has to
be adapted to the new control flow.
Diffstat (limited to 'src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp')
| -rw-r--r-- | src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp b/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp index a8064a5d0..26eb3a3ab 100644 --- a/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp +++ b/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp | |||
| @@ -202,7 +202,7 @@ public: | |||
| 202 | 202 | ||
| 203 | incomplete_phis[block].insert_or_assign(variable, phi); | 203 | incomplete_phis[block].insert_or_assign(variable, phi); |
| 204 | stack.back().result = IR::Value{&*phi}; | 204 | stack.back().result = IR::Value{&*phi}; |
| 205 | } else if (const std::span imm_preds{block->ImmediatePredecessors()}; | 205 | } else if (const std::span imm_preds = block->ImmPredecessors(); |
| 206 | imm_preds.size() == 1) { | 206 | imm_preds.size() == 1) { |
| 207 | // Optimize the common case of one predecessor: no phi needed | 207 | // Optimize the common case of one predecessor: no phi needed |
| 208 | stack.back().pc = Status::SetValue; | 208 | stack.back().pc = Status::SetValue; |
| @@ -257,7 +257,7 @@ public: | |||
| 257 | private: | 257 | private: |
| 258 | template <typename Type> | 258 | template <typename Type> |
| 259 | IR::Value AddPhiOperands(Type variable, IR::Inst& phi, IR::Block* block) { | 259 | IR::Value AddPhiOperands(Type variable, IR::Inst& phi, IR::Block* block) { |
| 260 | for (IR::Block* const imm_pred : block->ImmediatePredecessors()) { | 260 | for (IR::Block* const imm_pred : block->ImmPredecessors()) { |
| 261 | phi.AddPhiOperand(imm_pred, ReadVariable(variable, imm_pred)); | 261 | phi.AddPhiOperand(imm_pred, ReadVariable(variable, imm_pred)); |
| 262 | } | 262 | } |
| 263 | return TryRemoveTrivialPhi(phi, block, UndefOpcode(variable)); | 263 | return TryRemoveTrivialPhi(phi, block, UndefOpcode(variable)); |