================ @@ -431,6 +422,19 @@ MachineInstr *GCNDPPCombine::createDPPInst(MachineInstr &OrigMI, DPPInst.add(*TII->getNamedOperand(MovMI, AMDGPU::OpName::row_mask)); DPPInst.add(*TII->getNamedOperand(MovMI, AMDGPU::OpName::bank_mask)); DPPInst.addImm(CombBCZ ? 1 : 0); + + for (AMDGPU::OpName Op : + {AMDGPU::OpName::src0, AMDGPU::OpName::src1, AMDGPU::OpName::src2}) { + int OpIdx = AMDGPU::getNamedOperandIdx(DPPOp, Op); + if (OpIdx == -1) + break; + + if (!TII->isOperandLegal(*DPPInst, OpIdx)) { + LLVM_DEBUG(dbgs() << " failed: src operand is illegal\n"); ---------------- frederik-h wrote:
> Not sure we have a way to get the name of the index from the OpName As long as you only need to do this for the src operands, you could just replace the debug print by `LLVM_DEBUG(dbgs() << " failed: src" << i << " operand is illegal\n");` where you either keep track of the index i in the initializer list manually or you use `auto [i, OpName] : enumerate(std::array{AMDGPU::OpName::src0, AMDGPU::OpName::src1, AMDGPU::OpName::src2})` to iterate indices and values at the same time. https://github.com/llvm/llvm-project/pull/155595 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits