summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp')
-rw-r--r--src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp b/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp
index fe86a164b..3bab742e7 100644
--- a/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp
+++ b/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp
@@ -195,7 +195,7 @@ public:
195 case Status::Start: { 195 case Status::Start: {
196 if (const IR::Value& def = current_def.Def(block, variable); !def.IsEmpty()) { 196 if (const IR::Value& def = current_def.Def(block, variable); !def.IsEmpty()) {
197 stack.back().result = def; 197 stack.back().result = def;
198 } else if (!sealed_blocks.contains(block)) { 198 } else if (!block->IsSsaSealed()) {
199 // Incomplete CFG 199 // Incomplete CFG
200 IR::Inst* phi{&*block->PrependNewInst(block->begin(), IR::Opcode::Phi)}; 200 IR::Inst* phi{&*block->PrependNewInst(block->begin(), IR::Opcode::Phi)};
201 phi->SetFlags(IR::TypeOf(UndefOpcode(variable))); 201 phi->SetFlags(IR::TypeOf(UndefOpcode(variable)));
@@ -251,7 +251,7 @@ public:
251 std::visit([&](auto& variable) { AddPhiOperands(variable, *phi, block); }, variant); 251 std::visit([&](auto& variable) { AddPhiOperands(variable, *phi, block); }, variant);
252 } 252 }
253 } 253 }
254 sealed_blocks.insert(block); 254 block->SsaSeal();
255 } 255 }
256 256
257private: 257private:
@@ -297,7 +297,6 @@ private:
297 return same; 297 return same;
298 } 298 }
299 299
300 boost::container::flat_set<IR::Block*> sealed_blocks;
301 boost::container::flat_map<IR::Block*, boost::container::flat_map<Variant, IR::Inst*>> 300 boost::container::flat_map<IR::Block*, boost::container::flat_map<Variant, IR::Inst*>>
302 incomplete_phis; 301 incomplete_phis;
303 DefTable current_def; 302 DefTable current_def;