[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:51:51 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:

But we do not have that info this late. Only reg class and size. We would have to look at each opcode separately. Besides, isOperandLegal (which is what we are lying to here) does not seem to care about int/float.

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


More information about the llvm-commits mailing list