From f8563731ea107097e291ab299674552085833ea2 Mon Sep 17 00:00:00 2001 From: Vladislav Mikhalin Date: Sat, 14 Dec 2024 17:30:17 +0300 Subject: [PATCH] recompiler: emit a label right after s_branch to prevent dead code interferrence --- src/shader_recompiler/frontend/control_flow_graph.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/shader_recompiler/frontend/control_flow_graph.cpp b/src/shader_recompiler/frontend/control_flow_graph.cpp index 8c3122b28..0816ec088 100644 --- a/src/shader_recompiler/frontend/control_flow_graph.cpp +++ b/src/shader_recompiler/frontend/control_flow_graph.cpp @@ -80,6 +80,8 @@ void CFG::EmitLabels() { if (inst.IsUnconditionalBranch()) { const u32 target = inst.BranchTarget(pc); AddLabel(target); + // Emit this label so that the block ends with s_branch instruction + AddLabel(pc + inst.length); } else if (inst.IsConditionalBranch()) { const u32 true_label = inst.BranchTarget(pc); const u32 false_label = pc + inst.length;