diff options
Diffstat (limited to '')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/microinstruction.cpp | 4 | ||||
| -rw-r--r-- | src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/shader_recompiler/frontend/ir/microinstruction.cpp b/src/shader_recompiler/frontend/ir/microinstruction.cpp index efa426808..7555ac00a 100644 --- a/src/shader_recompiler/frontend/ir/microinstruction.cpp +++ b/src/shader_recompiler/frontend/ir/microinstruction.cpp | |||
| @@ -275,10 +275,6 @@ void Inst::AddPhiOperand(Block* predecessor, const Value& value) { | |||
| 275 | if (!value.IsImmediate()) { | 275 | if (!value.IsImmediate()) { |
| 276 | Use(value); | 276 | Use(value); |
| 277 | } | 277 | } |
| 278 | if (Flags<IR::Type>() == IR::Type::Void) { | ||
| 279 | // Set the type of the phi node | ||
| 280 | SetFlags<IR::Type>(value.Type()); | ||
| 281 | } | ||
| 282 | phi_args.emplace_back(predecessor, value); | 278 | phi_args.emplace_back(predecessor, value); |
| 283 | } | 279 | } |
| 284 | 280 | ||
diff --git a/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp b/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp index 346fcc377..ddd679e39 100644 --- a/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp +++ b/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp | |||
| @@ -176,6 +176,8 @@ public: | |||
| 176 | } else if (!sealed_blocks.contains(block)) { | 176 | } else if (!sealed_blocks.contains(block)) { |
| 177 | // Incomplete CFG | 177 | // Incomplete CFG |
| 178 | IR::Inst* phi{&*block->PrependNewInst(block->begin(), IR::Opcode::Phi)}; | 178 | IR::Inst* phi{&*block->PrependNewInst(block->begin(), IR::Opcode::Phi)}; |
| 179 | phi->SetFlags(IR::TypeOf(UndefOpcode(variable))); | ||
| 180 | |||
| 179 | incomplete_phis[block].insert_or_assign(variable, phi); | 181 | incomplete_phis[block].insert_or_assign(variable, phi); |
| 180 | stack.back().result = IR::Value{&*phi}; | 182 | stack.back().result = IR::Value{&*phi}; |
| 181 | } else if (const std::span imm_preds{block->ImmediatePredecessors()}; | 183 | } else if (const std::span imm_preds{block->ImmediatePredecessors()}; |
| @@ -187,6 +189,8 @@ public: | |||
| 187 | } else { | 189 | } else { |
| 188 | // Break potential cycles with operandless phi | 190 | // Break potential cycles with operandless phi |
| 189 | IR::Inst* const phi{&*block->PrependNewInst(block->begin(), IR::Opcode::Phi)}; | 191 | IR::Inst* const phi{&*block->PrependNewInst(block->begin(), IR::Opcode::Phi)}; |
| 192 | phi->SetFlags(IR::TypeOf(UndefOpcode(variable))); | ||
| 193 | |||
| 190 | WriteVariable(variable, block, IR::Value{phi}); | 194 | WriteVariable(variable, block, IR::Value{phi}); |
| 191 | 195 | ||
| 192 | stack.back().phi = phi; | 196 | stack.back().phi = phi; |