From 2b2915e27181e862a35ee11893efe8f92881da09 Mon Sep 17 00:00:00 2001 From: nmzik Date: Fri, 2 Oct 2026 00:04:35 +0400 Subject: [PATCH] Reuse SSA read traversal storage within each pass --- src/graphics/shader/recompiler/ir/passes/SsaRewrite.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/graphics/shader/recompiler/ir/passes/SsaRewrite.cpp b/src/graphics/shader/recompiler/ir/passes/SsaRewrite.cpp index fa6455145..566555cd8 100644 --- a/src/graphics/shader/recompiler/ir/passes/SsaRewrite.cpp +++ b/src/graphics/shader/recompiler/ir/passes/SsaRewrite.cpp @@ -165,7 +165,6 @@ Value InitialValue(M0Tag) { enum class ReadStep { Start, SetValue, PushPhiArgument }; -template struct ReadState { Block* block = nullptr; Value result; @@ -183,8 +182,8 @@ public: template Value Read(T variable, Block* root) { - std::vector> stack {{}, {.block = root}}; - const auto prepare_phi = [&]() { + stack.assign({{}, {.block = root}}); + const auto prepare_phi = [&]() { auto& state = stack.back(); const auto predecessors = state.block->ImmPredecessors(); if (state.pred == predecessors.size()) { @@ -290,6 +289,7 @@ private: std::unordered_map> incomplete_phis; DefTable definitions; + std::vector stack; }; void VisitInstruction(Pass& pass, Block* block, Inst& inst) {