[clang] [llvm] [PGO][OpenMP] Instrumentation for GPU devices (Revision of #76587) (PR #102691)

Ethan Luis McDonough via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 27 13:32:43 PDT 2024


================
@@ -985,7 +990,8 @@ void FunctionInstrumenter::instrument() {
         Intrinsic::getDeclaration(&M, PGOBlockCoverage
                                           ? Intrinsic::instrprof_cover
                                           : Intrinsic::instrprof_increment),
-        {Name, CFGHash, Builder.getInt32(NumCounters), Builder.getInt32(I++)});
+        {NormalizedNamePtr, CFGHash, Builder.getInt32(NumCounters),
+         Builder.getInt32(I++)});
----------------
EthanLuisMcDonough wrote:

Thanks for reaching out. `instrumentSelects` accepts a `GlobalVariable` as an argument, not a `Value`. The global variable addrspace cast handling is done inside `SelectInstVisitor::instrumentOneSelectInst`:

https://github.com/llvm/llvm-project/blob/ee764a2603269001aae808c906d2ed05ddbd0471/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp#L1728-L1734

I haven't encountered any errors raised by this snippet, but please let me know if you've been having any issues with it on your end.

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


More information about the cfe-commits mailing list