[llvm] [AMDGPU][SIInsertWaitcnt][NFC] Replace LastFlat array with distinct variables (PR #185993)

Sameer Sahasrabuddhe via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 2 22:26:23 PDT 2026


================
@@ -3073,10 +3074,13 @@ bool WaitcntBrackets::merge(const WaitcntBrackets &Other) {
 
     ScoreUBs[T] = NewUB;
 
-    StrictDom |= mergeScore(M, LastFlat[T], Other.LastFlat[T]);
+    if (T == LOAD_CNT)
----------------
ssahasra wrote:

Just thinking aloud, and not a request for change. I think this would be more readable if "PendingFlat" was a struct, and it had a `mergeScore()` method besides the getter and setter. Then the identity of "counters that actually matter" would be encapsulated in this struct and its methods. In particular, this `if (T == something)` check will disappear, and so will the specific references to `LastFlatLoadCnt` etc

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


More information about the llvm-commits mailing list