[PATCH] D102801: [CUDA][HIP] Fix implicit constant variable

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 19 12:55:25 PDT 2021


yaxunl created this revision.
yaxunl added a reviewer: tra.
Herald added a reviewer: aaron.ballman.
yaxunl requested review of this revision.

constexpr variables are implicit constant variables in device compilation.
Not all constexpr variables are valid to be emitted on device side, therefore
we should not force emit implicit constant variables even if they are
ODR-used by host code.

This fixes the regression caused by https://reviews.llvm.org/D102237


https://reviews.llvm.org/D102801

Files:
  clang/lib/CodeGen/CodeGenModule.cpp
  clang/lib/Sema/SemaCUDA.cpp
  clang/lib/Sema/SemaDeclAttr.cpp
  clang/test/AST/ast-dump-constant-var.cu
  clang/test/CodeGenCUDA/host-used-device-var.cu

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102801.346537.patch
Type: text/x-patch
Size: 7284 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210519/b55d017b/attachment-0001.bin>


More information about the cfe-commits mailing list