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

Nicolai Hähnle via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 5 09:30:45 PST 2025


================
@@ -362,6 +397,26 @@ class AMDGPUWaitSGPRHazards {
           Mask = AMDGPU::DepCtr::encodeFieldVaSdst(Mask, 0);
         }
         if (Emit) {
+          MachineInstr *PrevWaitAlu = nullptr;
+          if (MI != MI->getParent()->begin()) {
+            PrevWaitAlu = getPreviousWaitAlu(MI);
+          } else {
+            auto Preds = MBB.predecessors();
+            if (MBB.pred_size() == 1) {
----------------
nhaehnle wrote:

As discussed offline, let's not look across different basic blocks.

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


More information about the llvm-commits mailing list