[llvm] [AMDGPU] Remove s_delay_alu for VALU->SGPR->SALU (PR #127212)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 24 07:54:17 PST 2025


================
@@ -377,6 +413,17 @@ class AMDGPUInsertDelayAlu : public MachineFunctionPass {
             }
           }
         }
+
+        if (SII->isVALU(MI.getOpcode())) {
+          for (const auto &Op : MI.defs()) {
+            Register Reg = Op.getReg();
+            if (AMDGPU::isSGPR(Reg, TRI)) {
+              lastSGPRfromVALU = *(TRI->regunits(Reg).begin());
----------------
jayfoad wrote:

```suggestion
              lastSGPRfromVALU = TRI->regunits(Reg).front();
```
Or use `[0]`.

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


More information about the llvm-commits mailing list