diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-04-17 21:40:35 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:28 +0200 |
commit | 50f8007172ce143a632270510f96093c82018952 (patch) | |
tree | 6ffa823c458ef26f717a18c4e5216c2048272ac3 /src/shader_recompiler/ir_opt | |
parent | shader: Fix memory barriers (diff) | |
download | yuzu-50f8007172ce143a632270510f96093c82018952.tar yuzu-50f8007172ce143a632270510f96093c82018952.tar.gz yuzu-50f8007172ce143a632270510f96093c82018952.tar.bz2 yuzu-50f8007172ce143a632270510f96093c82018952.tar.lz yuzu-50f8007172ce143a632270510f96093c82018952.tar.xz yuzu-50f8007172ce143a632270510f96093c82018952.tar.zst yuzu-50f8007172ce143a632270510f96093c82018952.zip |
Diffstat (limited to '')
-rw-r--r-- | src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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: } else if (!sealed_blocks.contains(block)) { // Incomplete CFG IR::Inst* phi{&*block->PrependNewInst(block->begin(), IR::Opcode::Phi)}; + phi->SetFlags(IR::TypeOf(UndefOpcode(variable))); + incomplete_phis[block].insert_or_assign(variable, phi); stack.back().result = IR::Value{&*phi}; } else if (const std::span imm_preds{block->ImmediatePredecessors()}; @@ -187,6 +189,8 @@ public: } else { // Break potential cycles with operandless phi IR::Inst* const phi{&*block->PrependNewInst(block->begin(), IR::Opcode::Phi)}; + phi->SetFlags(IR::TypeOf(UndefOpcode(variable))); + WriteVariable(variable, block, IR::Value{phi}); stack.back().phi = phi; |