recompiler: emit a label right after s_branch to prevent dead code interferrence (#1785)

This commit is contained in:
Vladislav Mikhalin 2024-12-14 23:46:55 +03:00 committed by GitHub
parent f93677b953
commit 876445faf1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;