From 97c01bc96c646e7fe33a1327ec17a0a8cacd0c2a Mon Sep 17 00:00:00 2001 From: CHatingPython Date: Fri, 12 Jun 2026 23:09:36 +0200 Subject: [PATCH] refactor(furc/ssa): add exit instruction awareness Refs: #2 --- furc/src/front/ssa.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/furc/src/front/ssa.cpp b/furc/src/front/ssa.cpp index c3090ff..fc991ad 100644 --- a/furc/src/front/ssa.cpp +++ b/furc/src/front/ssa.cpp @@ -200,6 +200,14 @@ void ssa::optimize(const std::unique_ptr& func) { } } + for (auto& operand : block->exit()->sources()) { + if (operand->type() != furlang::ir::operand_t::Register) continue; + auto orig = operand->reg(); + if (!regVerStacks[orig].empty()) { + operand->reg().ver = regVerStacks[orig].top(); + } + } + for (auto succIndex : successors[blockIndex]) { const auto& succ = func->blocks()[succIndex]; for (auto& instr : succ->instructions()) {