[llvm] AMDGPU: VALU data fast-forwarding needs no s_delay (PR #205481)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 28 08:22:00 PDT 2026


================
@@ -427,11 +648,22 @@ class AMDGPUInsertDelayAlu {
 
       if (Type != OTHER) {
         // TODO: Scan implicit defs too?
-        for (const auto &Op : MI.defs()) {
+        Register VccReg = AMDGPU::LaneMaskConstants::get(*ST).VccReg;
+        Register ExecReg = AMDGPU::LaneMaskConstants::get(*ST).ExecReg;
+        for (const auto &Op : MI.all_defs()) {
+          unsigned OperandNo = MI.getOperandNo(&Op);
+          Register Reg = Op.getReg();
+          if (OperandNo >= MI.getDesc().getNumOperands() &&
+              !MI.getDesc().hasImplicitDefOfPhysReg(Reg))
+            continue;
+
           unsigned Latency = SchedModel->computeOperandLatency(
               &MI, Op.getOperandNo(), nullptr, 0);
-          for (MCRegUnit Unit : TRI->regunits(Op.getReg()))
-            State[Unit] = DelayInfo(Type, Latency);
+          DelayInfo Info(Type, Latency);
+
+          Info.IsFFProducer = isFastForwardProducer(MI, Op, VccReg, ExecReg);
----------------
jayfoad wrote:

Maybe change the DelayInfo constructor to take this as a third argument?

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


More information about the llvm-commits mailing list