[llvm] [AMDGPU] Simplify state clearing in SIInsertWaitcnts. NFC. (PR #186399)

via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 16 09:53:13 PDT 2026


vporpo wrote:

> I am not sure that is a good idea. Why should the pass manager be aware of pass details, unless they are part of the standard API between PM and Pass?

The pass manager doesn't really care about the pass details, it just calls runOnFunction(). But the pass class is not usually empty, it contains the state that lives across functions. In the new PM the pass manager needs to have the pass class definition available, which is why the header file is needed.

> That sounds a bit strange to me. "Changing the pass logic"[1] sounds like a goal of having a new pass manager in the first place.

I doubt this was ever the intended goal. If the PM wanted to enforce passes to not maintain state across functions this would have been designed very differently, the pass objects would be created and destroyed for every function by the PM.

> I don't see how this is related to the pass manager. What are there things in base-info, that could have been in insert-waitcnts, but are required by pass manager??

It's not related to the pass manager. It's a general comment about moving some of the SIInsertWaitcnt stuff that is currently in AMDBaseInfo to SIInsertWaitcnts.h, like some of the enums.

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


More information about the llvm-commits mailing list