[llvm-branch-commits] [llvm] [AMDGPU][NewInsertWaitcnt] Event Tracker (2/2) (PR #232344)
Pierre van Houtryve via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Nov 5 02:11:07 PST 2026
https://github.com/Pierre-vh commented:
@ssahasra I'll answer the other comments here as it's easier to do all at once.
First, I renamed "height" to "age". I think a lot of the confusion here is due to how bad the name is. "Age" may not be perfect but it's really the closest match I can think of. I think that may help with the 2 following comments:
> So the height is the minimum estimate of how many events were added after this one?
>
> I am still struggling to think of this as a "height". The event is on a timeline, and there are events before and after this one. Sure, there are other timelines, but they can be merged. Height conjures the picture of a stack, but then a stack is a LIFO, not a FIFO.
As for:
> This doesn't really explain why minimum. When two timelines reach the same candidate wait event, and an event E is at position P1 and P2 respectively in those timelines, then what is the property that the merged timeline satisfy? Say P1 is numerically larger than P2, so the new height is P2. What happens to all the events that exist after P1 on the corresponding timeline?
I think you hit the nail on the head with:
> then what is the property that the merged timeline satisfy
The merged timeline has one mission: If you inspect it and find a record that you need, you must be able to emit a waicnt N where N is the age of the record to access it safely.
I added a paragraph in the docs of EventTrackerRecord to insist on that:
```
/// The primary motivation for this system is that we want the capability to
/// determine what kind of waitcnt must be emitted for a given event (record) to
/// complete. For example, let R be a record in the timeline of a counter T,
/// then a "waitcnt_T N" (a "drain") where N is <= the age of R must be
/// sufficient to guarantee that R has completed (and its results can be used).
```
I hope these few fixes help clarify the system ?
https://github.com/llvm/llvm-project/pull/232344
More information about the llvm-branch-commits
mailing list