nak: Insert the annotation in the right spot in assign_regs

Fixes: efc4ac0d27 ("nak/sm50: sprinkle OpAnnotate in optimization passes")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34201>
This commit is contained in:
Faith Ekstrand 2025-03-25 16:38:22 -05:00 committed by Marge Bot
parent 824e1876f0
commit 98677294b9

View file

@ -1387,14 +1387,14 @@ impl AssignRegsBlock {
pcopy.push(dst.into(), src.into());
}
if DEBUG.annotate() {
b.instrs.push(Instr::new_boxed(OpAnnotate {
annotation: "generated by assign_regs".into(),
}));
}
let ann = OpAnnotate {
annotation: "generated by assign_regs".into(),
};
if b.branch().is_some() {
b.instrs.insert(b.instrs.len() - 1, Instr::new_boxed(ann));
b.instrs.insert(b.instrs.len() - 1, Instr::new_boxed(pcopy));
} else {
b.instrs.push(Instr::new_boxed(ann));
b.instrs.push(Instr::new_boxed(pcopy));
}
}