[llvm] (reland) [AMDGPU][SIInsertWaitCnts] Use RegUnits-based tracking (#162077) (PR #171779)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 11 09:03:02 PST 2025


jayfoad wrote:

> > I do not understand why this changes anything. The old code should have worked, because accessing VMem[RegID].Scores[T] implicitly created a default entry for VMem[RegID] if none existed before. I checked this when I reviewed the original patch!
> 
> Yes, but we only iterated using the keys from the "Other" map. If the map in the current object had more keys, we did not visit (call `mergeScore`) on them.

Yeah, I came to the same conclusion myself after I posted that comment earlier - the issue is that you can't elide the call to mergeScore for a key that is in this map but not the other map, because it's not a no-op even in that case.

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


More information about the llvm-commits mailing list