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

David Li via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 18 09:40:29 PDT 2026


================
@@ -117,6 +119,16 @@ cl::opt<bool> AtomicCounterUpdateAll(
     cl::desc("Make all profile counter updates atomic (for testing only)"),
     cl::init(false));
 
+cl::opt<bool> AtomicCounterPromote(
+    "atomic-counter-promote",
+    cl::desc("Atomize profile counter updates and promote where possible"),
----------------
david-xl wrote:

It is overly conservative -- the order of counter update does not matter, so it can be relaxed.

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


More information about the cfe-commits mailing list