[llvm] [AMDGPU] Src1 of VOP3 DPP instructions can be SGPR on supported subtargets (PR #67461)

Mirko BrkuĊĦanin via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 28 08:37:32 PDT 2023


================
@@ -301,7 +302,14 @@ MachineInstr *GCNDPPCombine::createDPPInst(MachineInstr &OrigMI,
     }
     auto *Src1 = TII->getNamedOperand(OrigMI, AMDGPU::OpName::src1);
     if (Src1) {
-      if (!TII->isOperandLegal(*DPPInst.getInstr(), NumOperands, Src1)) {
+      int OpNum = NumOperands;
+      // If subtarget does not support SGPRs for src1 operand then the
+      // requirements are the same as for src0. We check src0 instead because
+      // pseudos are shared between subtargets and allow SGPR for src1 on all.
----------------
mbrkusanin wrote:

I've added the assert for size but I'm not sure what float/not float match would be.

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


More information about the llvm-commits mailing list