[clang] [llvm] [Offload][PGO] Fix PGO on NVPTX targets (PR #143568)
Kevin Sala Penades via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 23 09:53:07 PDT 2025
================
@@ -947,11 +954,18 @@ bool InstrLowerer::lower() {
if (!ContainsProfiling && !CoverageNamesVar)
return MadeChange;
+ // Cached info for generating delayed offset calculations
+ // This is only relevant on NVPTX targets
+ SmallVector<Function *> Kernels;
+ SmallVector<const InstrProfCntrInstBase *> ValueSites;
----------------
kevinsala wrote:
@jhuber6 Could you provide more detail on the solution you are proposing?
I'm not familiar with this code, but it seems that the case is similar to the one below, where the address of @__profd is used in the initializer. I don't see how to implement it cleanly in the initializers.
```
@__profc = global ...
@__profd = global { i64, i64, i64, ... } { ..., ..., i64 sub (ptrtoint @__profc, ptrtoint @__profd), ... }
```
https://github.com/llvm/llvm-project/pull/143568
More information about the cfe-commits
mailing list