[clang] [llvm] [AMDGPU][SIInsertWaitcnt] Implement Waitcnt Expansion for Profiling (PR #169345)

Jay Foad via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 13 07:57:33 PST 2026


================
@@ -348,9 +372,11 @@ class WaitcntGenerator {
 
   // Generates new wait count instructions according to the  value of
   // Wait, returning true if any new instructions were created.
+  // If ScoreBrackets is provided, it can be used for profiling expansion.
   virtual bool createNewWaitcnt(MachineBasicBlock &Block,
                                 MachineBasicBlock::instr_iterator It,
-                                AMDGPU::Waitcnt Wait) = 0;
+                                AMDGPU::Waitcnt Wait,
+                                WaitcntBrackets *ScoreBrackets = nullptr) = 0;
----------------
jayfoad wrote:

All callers provide the `ScoreBrackets` argument so why make it optional?

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


More information about the cfe-commits mailing list