diff options
| author | 2021-05-14 04:48:46 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:31 -0400 | |
| commit | bf5e48ffe4bd48ea681f2a01c8919c97125e88df (patch) | |
| tree | 2127c2f01aa19b98672f1ac9f34395b9b0240b3e /src/shader_recompiler/ir_opt | |
| parent | glasm: Write result to scalar on integer comparison instructions (diff) | |
| download | yuzu-bf5e48ffe4bd48ea681f2a01c8919c97125e88df.tar.gz yuzu-bf5e48ffe4bd48ea681f2a01c8919c97125e88df.tar.xz yuzu-bf5e48ffe4bd48ea681f2a01c8919c97125e88df.zip | |
glasm: Initial implementation of phi nodes on GLASM
Diffstat (limited to 'src/shader_recompiler/ir_opt')
| -rw-r--r-- | src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp b/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp index 26eb3a3ab..e54499ba5 100644 --- a/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp +++ b/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp | |||
| @@ -138,10 +138,6 @@ IR::Opcode UndefOpcode(IndirectBranchVariable) noexcept { | |||
| 138 | return IR::Opcode::UndefU32; | 138 | return IR::Opcode::UndefU32; |
| 139 | } | 139 | } |
| 140 | 140 | ||
| 141 | [[nodiscard]] bool IsPhi(const IR::Inst& inst) noexcept { | ||
| 142 | return inst.GetOpcode() == IR::Opcode::Phi; | ||
| 143 | } | ||
| 144 | |||
| 145 | enum class Status { | 141 | enum class Status { |
| 146 | Start, | 142 | Start, |
| 147 | SetValue, | 143 | SetValue, |
| @@ -283,7 +279,7 @@ private: | |||
| 283 | list.erase(IR::Block::InstructionList::s_iterator_to(phi)); | 279 | list.erase(IR::Block::InstructionList::s_iterator_to(phi)); |
| 284 | 280 | ||
| 285 | // Find the first non-phi instruction and use it as an insertion point | 281 | // Find the first non-phi instruction and use it as an insertion point |
| 286 | IR::Block::iterator reinsert_point{std::ranges::find_if_not(list, IsPhi)}; | 282 | IR::Block::iterator reinsert_point{std::ranges::find_if_not(list, IR::IsPhi)}; |
| 287 | if (same.IsEmpty()) { | 283 | if (same.IsEmpty()) { |
| 288 | // The phi is unreachable or in the start block | 284 | // The phi is unreachable or in the start block |
| 289 | // Insert an undefined instruction and make it the phi node replacement | 285 | // Insert an undefined instruction and make it the phi node replacement |