================
@@ -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);
----------------
yxsamliu wrote:
Refactored this into a small local `ProfileSectionCopy` helper. It keeps the
existing no-STL runtime style, but removes the repeated per-section
allocation/copy/cache blocks.
https://github.com/llvm/llvm-project/pull/190708
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits