Skip to content

Commit

Permalink
recompiler: emit a label right after s_branch to prevent dead code in…
Browse files Browse the repository at this point in the history
…terferrence (#1785)
  • Loading branch information
roamic authored Dec 14, 2024
1 parent f93677b commit 876445f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/shader_recompiler/frontend/control_flow_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 876445f

Please sign in to comment.