[llvm] [AMDGPU] Fix dropped Asyncmarks when new AsyncScore is empty (PR #191894)

Robert Imschweiler via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 14 05:35:44 PDT 2026


================
@@ -1301,7 +1301,13 @@ void WaitcntBrackets::recordAsyncMark(MachineInstr &Inst) {
   // limit every time we push a new mark, but that seems like unnecessary work
   // in practical cases. We do separately truncate the array when processing a
   // loop, which should be sufficient.
-  AsyncMarks.push_back(AsyncScore);
+  CounterValueArray MergedScore = AsyncScore;
+  if (!AsyncMarks.empty()) {
+    const auto &PrevMark = AsyncMarks.back();
+    for (auto T : inst_counter_types(Context->MaxCounter))
----------------
ro-i wrote:

usually, auto is avoided in llvm core, except for cases where the type is trivially visible inline, e.g., in `auto BB = dyn_cast<BasicBlock>(V)`

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


More information about the llvm-commits mailing list