[llvm] [AMDGPU] Merge consecutive wait_alu instruction (PR #128916)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 26 17:33:34 PST 2025


================
@@ -362,6 +377,13 @@ class AMDGPUWaitSGPRHazards {
           Mask = AMDGPU::DepCtr::encodeFieldVaSdst(Mask, 0);
         }
         if (Emit) {
+          if (MI != MI->getParent()->begin()) {
+            MachineInstr &PrevMI = *std::prev(MI);
----------------
arsenm wrote:

You need to skip over debug instructions to avoid them changing the result 

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


More information about the llvm-commits mailing list