From 98677294b9aea472d7e73d3a00261440a063307c Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Tue, 25 Mar 2025 16:38:22 -0500 Subject: [PATCH] nak: Insert the annotation in the right spot in assign_regs Fixes: efc4ac0d27ee ("nak/sm50: sprinkle OpAnnotate in optimization passes") Part-of: --- src/nouveau/compiler/nak/assign_regs.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/nouveau/compiler/nak/assign_regs.rs b/src/nouveau/compiler/nak/assign_regs.rs index 8ff732ba69b..7cfbfa2351b 100644 --- a/src/nouveau/compiler/nak/assign_regs.rs +++ b/src/nouveau/compiler/nak/assign_regs.rs @@ -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)); } }