Skip to content

Commit 876445f

Browse files
authored
recompiler: emit a label right after s_branch to prevent dead code interferrence (#1785)
1 parent f93677b commit 876445f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/shader_recompiler/frontend/control_flow_graph.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ void CFG::EmitLabels() {
8080
if (inst.IsUnconditionalBranch()) {
8181
const u32 target = inst.BranchTarget(pc);
8282
AddLabel(target);
83+
// Emit this label so that the block ends with s_branch instruction
84+
AddLabel(pc + inst.length);
8385
} else if (inst.IsConditionalBranch()) {
8486
const u32 true_label = inst.BranchTarget(pc);
8587
const u32 false_label = pc + inst.length;

0 commit comments

Comments
 (0)