[PATCH] D107718: [cuda] Mark builtin texture/surface reference variable as 'externally_initialized'.

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 9 09:13:18 PDT 2021


yaxunl added a comment.

LGTM on HIP side. I am not sure whether CUDA needs this.



================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:4441
       if (Linkage != llvm::GlobalValue::InternalLinkage &&
-          (D->hasAttr<CUDADeviceAttr>() || D->hasAttr<CUDAConstantAttr>()))
+          (D->hasAttr<CUDADeviceAttr>() || D->hasAttr<CUDAConstantAttr>() ||
+           D->getType()->isCUDADeviceBuiltinSurfaceType() ||
----------------
hliao wrote:
> yaxunl wrote:
> > we need also do this with variables with HIPManagedAttr and add a test for that
> those managed var seems already being marked 'externally_initalized' in lib/CodeGen/CGCUDANV.cpp. Do you have missing places to mark them?
sorry, I fogot. Then it should be OK. We don't have other places to handle managed variables.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107718/new/

https://reviews.llvm.org/D107718



More information about the cfe-commits mailing list