[llvm] [AMDGPU][NFC] Move InstCounterType and Waitcnt to SIInsertWaitcnts.h (PR #187823)

via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 2 09:18:00 PDT 2026


vporpo wrote:

> Why is the file called SIInsertWaitcnts.h? I don't see anything specific to that pass in that file. It should simply be called Waitcnts.h.

Because InstCounterType and Waitcnt are classes thar are only used in SIInsertWaitcnts with one exception.

> Anything that is only used by SIInsertWaitcnt.cpp should not be in this header file.

They can't move to SIInsertWaitcnts.cpp because there is a use of Waitcnt in the hazard recognizer, so unless this is hard-coded as Jay suggested, the next best thing is to move these to the header file.

> All things related to waitcnts need to be moved here. This includes anything that is left in BaseInfo.h. Without that, this is a half-hearted cleanup. For someone who only wants to manipulate waitcnts, there should be no reason to include BaseInfo.h.

I don't see anything Waitcnt related left in BaseInfo. You don't need to include BaseInfo if you work with Waitcnt.

If you are referring to the encoding/decoding stuff, these are not directly related to the Waitcnt class so it can be a separate cleanup patch.

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


More information about the llvm-commits mailing list