[llvm] [AMDGPU][SIInsertWaitcnts] drop OldWaitcntInstr only when it is processed (PR #145720)
Sameer Sahasrabuddhe via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 30 02:21:02 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;
----------------
ssahasra wrote:
I don't see how we can do that. When we enter `generateWaitcntInstBefore()`, `OldWaitcntInstr` is simply the first such instruction that was found, waiting to be included in a computation. The call actually processes a range starting from `OldWaitcntInstr` to `Inst`. See the `for` loop inside `applyPreexistingWaitcnt()`. It's not enough to just check `Inst` or `OldWaitcntInstr` at this point in the code.
https://github.com/llvm/llvm-project/pull/145720
More information about the llvm-commits
mailing list