================
@@ -862,14 +862,18 @@ static void instrumentOneFunc(
   auto Name = FuncInfo.FuncNameVar;
   auto CFGHash = ConstantInt::get(Type::getInt64Ty(M->getContext()),
                                   FuncInfo.FunctionHash);
+  // Make sure that pointer to global is passed in with zero addrspace
+  // This is relevant during GPU profiling
+  auto *NormalizedPtr = llvm::ConstantExpr::getPointerBitCastOrAddrSpaceCast(
+      Name, llvm::PointerType::getUnqual(M->getContext()));
----------------
arsenm wrote:

Avoid getUnqual, use an explicit 0 addrspace.

Also there should be no reason to emit pointer bitcast, simplify to just create 
addrspacecast 

https://github.com/llvm/llvm-project/pull/76587
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to