[llvm] [AMDGPU][SIInsertWaitcnts][NFC] Move instr events code into separate function (PR #180864)

via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 11 08:34:13 PST 2026


================
@@ -2660,120 +2662,110 @@ bool SIInsertWaitcnts::insertForcedWaitAfter(MachineInstr &Inst,
   return Result;
 }
 
-void SIInsertWaitcnts::updateEventWaitcntAfter(MachineInstr &Inst,
-                                               WaitcntBrackets *ScoreBrackets) {
-  // Now look at the instruction opcode. If it is a memory access
-  // instruction, update the upper-bound of the appropriate counter's
-  // bracket and the destination operand scores.
-  // For architectures with X_CNT, mark the source address operands
-  // with the appropriate counter values.
-  // TODO: Use the (TSFlags & SIInstrFlags::DS_CNT) property everywhere.
-
-  bool IsVMEMAccess = false;
-  bool IsSMEMAccess = false;
-
+SmallVector<WaitEventType>
----------------
vporpo wrote:

Not sure if it would be cheaper. If we use a vector we have more expensive push_back because of reallocation (though that could be mitigated with a `SmallVector<WaitEventType, 4>` or similar). If we use the set then inserts are cheap, but the final iteration needs to iterate through all the event types and check if each one of them is set. Wdyt ?

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


More information about the llvm-commits mailing list