[llvm] [AMDGPU][SIInsertWaitcnts][NFC] Introduce Counter class (PR #190271)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 15 10:17:04 PDT 2026
vporpo wrote:
> The only thing missing is direction. We know where we are going away from, but it's not clear where we are heading.
The document shared internally is already listing both the problem and the proposed solution, i.e., the introduction of the `Counter` class as a first step and the introduction of the `Score` class tied to each counter as a second step. It is even listing the actual code for the `Counter` class with the complete API, where none of the TODO functions are present. So I am not sure which part of the "direction" is not clear to you.
To reiterate, the changes related to the `Counter` class are straightforward: we create a class for the counters with a high-level API that not only hides the internal implementation but also expresses intent with functions like `getCount()`, `contains()`, `advance()` etc. So instead of having code snippets all over the pass with raw access to the internals of the counter, we will now have them go through an API. These are fairly basic changes that stand by themselves and don't really depend on any high-level plan.
Anyway, to help address your concerns I pushed a future snapshot of the Counter class here : https://github.com/vporpo/llvm-project/commit/4f12ae1e2c69cb59f698127417910178fcf553c4 . It contains this patch + several follow-up patches squashed in one. It is very similar to the one in the document with some functions named differently.
https://github.com/llvm/llvm-project/pull/190271
More information about the llvm-commits
mailing list