[llvm] [AMDGPU][SIInsertWaitcnts] drop OldWaitcntInstr only when it is processed (PR #145720)

Juan Manuel Martinez CaamaƱo via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 30 01:36:43 PDT 2025


================
@@ -2490,7 +2493,6 @@ bool SIInsertWaitcnts::insertWaitcntInBlock(MachineFunction &MF,
     // Generate an s_waitcnt instruction to be placed before Inst, if needed.
     Modified |= generateWaitcntInstBefore(Inst, ScoreBrackets, OldWaitcntInstr,
                                           FlushVmCnt);
-    OldWaitcntInstr = nullptr;
----------------
jmmartinez wrote:

If I follow everything, the main case where assigning `OldWaitcntInstr` to `nullptr` here was problematic was for meta-instructions ? Or is there another case ?

If that's the case, we could skip meta-instructions directly in the this loop.

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


More information about the llvm-commits mailing list