[llvm] [AMDGPU] misched: avoid subregister dependencies (PR #140255)

Robert Imschweiler via llvm-commits llvm-commits at lists.llvm.org
Fri May 16 12:32:46 PDT 2025


================
@@ -535,6 +535,62 @@ unsigned GCNSubtarget::getMaxNumVGPRs(const MachineFunction &MF) const {
   return getBaseMaxNumVGPRs(F, MFI.getWavesPerEU());
 }
 
+bool GCNSubtarget::isRealSchedDependency(MachineInstr *DefI, int DefOpIdx,
+                                         MachineInstr *UseI,
+                                         int UseOpIdx) const {
+  if (!InstrInfo.isVOP3P(*UseI))
+    return true;
+  MachineOperand &DefOp = DefI->getOperand(DefOpIdx);
+  if (!DefOp.isReg() || !DefOp.getReg().isPhysical())
+    return true;
----------------
ro-i wrote:

Regunits, subregs, regsOverlap, etc. are mostly defined on `MCRegister` and `Register::asMCReg()` requires a the register to be physical. That's why I thought that most of the stuff I need is only available post-ra (?)

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


More information about the llvm-commits mailing list