[llvm] [PGO] Implement PGO counter promotion for atomic updates (PR #202487)

Wael Yehia via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 15 08:14:47 PDT 2026


================
@@ -524,6 +556,20 @@ class PGOCounterPromoter {
   }
 
   bool run(int64_t *NumPromoted) {
+    // In this function we examine loop L and other parameters to decide what
+    // candidates are promotable. Once we've promoted what we can, we convert
+    // all remaining candidates to use atomics. This requires that promoted
+    // candidates are set to nullptr in the LoopToCandidates[&L] array.
+    llvm::scope_exit Cleanup([&]() {
----------------
w2yehia wrote:

I ended up taking your suggestion of using a wrapper.

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


More information about the llvm-commits mailing list