[clang] [compiler-rt] [llvm] [PGO][AMDGPU] Add uniformity-aware offload profile format and instrumentation (PR #190708)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 3 06:16:09 PDT 2026


================
@@ -634,9 +644,22 @@ static int processDeviceOffloadPrf(void *DeviceOffloadPrf, int TUIndex,
     NamesOwner.reset(HostNamesBegin);
   }
 
+  if (UniformCountersSize > 0 && DevUniformCntsBegin == CachedDevUCntsBegin &&
+      UniformCountersSize == CachedUCntsSize) {
+    HostUniformCountersBegin = CachedHostUCnts;
+    UCntsReused = 1;
+    if (isVerboseMode())
+      PROF_NOTE("Reusing cached ucnts section (%zu bytes)\n",
+                UniformCountersSize);
+  } else if (UniformCountersSize > 0) {
+    HostUniformCountersBegin = (char *)malloc(UniformCountersSize);
----------------
arsenm wrote:

Move this code to be more C++ like?

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


More information about the cfe-commits mailing list