[llvm] [AMDGPU] Fix bad removal of s_delay_alu (PR #145728)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 26 07:26:45 PDT 2025


================
@@ -49,9 +49,16 @@ class AMDGPUInsertDelayAlu {
 
   static bool instructionWaitsForSGPRWrites(const MachineInstr &MI) {
     // These instruction types wait for VA_SDST==0 before issuing.
-    const uint64_t VA_SDST_0 = SIInstrFlags::SALU | SIInstrFlags::SMRD;
+    uint64_t MIFlags = MI.getDesc().TSFlags;
+    if (MIFlags & SIInstrFlags::SMRD)
+      return true;
 
-    return MI.getDesc().TSFlags & VA_SDST_0;
+    if (MIFlags & SIInstrFlags::SALU) {
+      for (auto &Op : MI.operands())
----------------
jayfoad wrote:

Nit: the for loop should have braces.

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


More information about the llvm-commits mailing list