[llvm] AMDGPU: Mark the SCC def dead when expanding 64-bit scalar add/sub (PR #226269)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 25 04:02:10 PDT 2026


================
@@ -5707,6 +5707,7 @@ static MachineBasicBlock *expand64BitScalarArithmetic(MachineInstr &MI,
   MachineOperand &Src1 = MI.getOperand(2);
   bool IsAdd = (MI.getOpcode() == AMDGPU::S_ADD_U64_PSEUDO);
   if (ST.hasScalarAddSub64()) {
+    // FIXME: If scc is used, this deletes the def
----------------
jayfoad wrote:

There isn't anything to fix here? We just need to be clear that the SCC def on S_ADD/SUB_U64_PSEUDO is a clobber, i.e. it sets SCC to undef, not to whether the whole 64-bit result is nonzero.

o you mean we should insert something like an IMPLICIT_DEF of SCC if there do happen to be any uses of the (undef) value, for some bizarre reason?

https://github.com/llvm/llvm-project/pull/226269


More information about the llvm-commits mailing list