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

Pierre van Houtryve via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 7 01:13:18 PDT 2025


Pierre-vh wrote:

> > One issue I've had with that is that I'm not sure how to tell if a RU is a SGPR or VGPR.
> 
> You can get the unit's "root" register and test that. See MCRegUnitRootIterator. AMDGPU does not use ad hoc aliasing so I think every unit should have exactly one root.

Is it worth adding this (potentially expensive?) query just so I can merge a few methods together though ?
I also thought about merging everything into a single map, then make the Value of the map some type of variant with different fields depending on whether the key is a VGPR/SGPR/SCC/LDSDMA. That'd be a bit less space efficient, but would streamline the implementation.

Perhaps I can try it in another diff on top of this ? This diff already changes a lot of thing, I want to make sure it doesn't become too big to review or debug in case of an issue.

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


More information about the llvm-commits mailing list