[llvm] [AMDGPU] misched: avoid subregister dependencies (PR #140255)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 2 17:54:28 PST 2025
================
@@ -627,6 +627,124 @@ GCNSubtarget::getMaxNumVectorRegs(const Function &F) const {
return std::pair(MaxNumVGPRs, MaxNumAGPRs);
}
+// Check to which source operand UseOpIdx points to and return a pointer to the
+// operand of the corresponding source modifier.
+// Return nullptr if UseOpIdx either doesn't point to src0/1/2 or if there is no
+// operand for the corresponding source modifier.
+static const MachineOperand *
+getVOP3PSourceModifierFromOpIdx(const MachineInstr *UseI, int UseOpIdx,
+ const SIInstrInfo &InstrInfo) {
+ AMDGPU::OpName UseModName;
+ AMDGPU::OpName UseName =
+ AMDGPU::getOperandIdxName(UseI->getOpcode(), UseOpIdx);
+ switch (UseName) {
+ case AMDGPU::OpName::src0:
+ UseModName = AMDGPU::OpName::src0_modifiers;
+ break;
----------------
arsenm wrote:
```suggestion
return InstrInfo.getNamedOperand(*UseI, AMDGPU::OpName::src0_modifiers)
```
https://github.com/llvm/llvm-project/pull/140255
More information about the llvm-commits
mailing list