[llvm] [AMDGPU][SIInsertWaitcnt][NFC] Make getWait() and getCounterRef() member functions (PR #178345)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 28 09:43:38 PST 2026


vporpo wrote:

> TLDR: IMO moving HardwareLimits into AMDGPUBaseInfo (https://github.com/llvm/llvm-project/pull/169345) was a mistake and moving more stuff into AMDGPUBaseInfo is even worse.

I see. As far as I can tell the only users of HardwareLimits are in SIInsertWaitcnt, so yeah I don't see the reason of it being in AMDGPUBaseInfo.

But I think the main question is whether moving InstCounterType enum to AMDGPUBaseInfo is a good thing. On one hand the enum is only used within SIInsertWaitcnt so one could argue that exposing it to others is not great from a design point. However, Waitcnt is structured based on the order of the enum elements so there is strong coupling between the two, requiring awkward functions like getWaitcntRef() to access the data using the enum. I would argue that exposing InstCounterType is a small price to pay for cleaning up the accesses to the elements of Waitcnt and avoiding the awkward cross-file coupling caused by having the enum defined in one file and data-structures that are structured based on it in another.

Any thoughts ?

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


More information about the llvm-commits mailing list