[flang] [lldb] [clang-tools-extra] [libcxx] [compiler-rt] [lld] [openmp] [clang] [libc] [llvm] [PGO][OpenMP] Instrumentation for GPU devices (PR #76587)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 8 22:35:52 PST 2024


================
@@ -959,8 +959,12 @@ void CodeGenPGO::emitCounterIncrement(CGBuilderTy &Builder, const Stmt *S,
 
   unsigned Counter = (*RegionCounterMap)[S];
 
-  llvm::Value *Args[] = {FuncNameVar,
-                         Builder.getInt64(FunctionHash),
+  // Make sure that pointer to global is passed in with zero addrspace
+  // This is relevant during GPU profiling
+  auto *NormalizedPtr = llvm::ConstantExpr::getPointerBitCastOrAddrSpaceCast(
+      FuncNameVar, llvm::PointerType::getUnqual(CGM.getLLVMContext()));
----------------
arsenm wrote:

Avoid using getUnqual. I'm sure there's a proper address space to query somewhere here 

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


More information about the cfe-commits mailing list