forked from OSchip/llvm-project
049d860707
constexpr variables are compile time constants and implicitly const, therefore they are safe to emit on both device and host side. Besides, in many cases they are intended for both device and host, therefore it makes sense to emit them on both device and host sides if necessary. In most cases constexpr variables are used as rvalue and the variables themselves do not need to be emitted. However if their address is taken, then they need to be emitted. For C++14, clang is able to handle that since clang emits them with available_externally linkage together with the initializer. However for C++17, the constexpr static data member of a class or template class become inline variables implicitly. Therefore they become definitions with linkonce_odr or weak_odr linkages. As such, they can not have available_externally linkage. This patch fixes that by adding implicit constant attribute to file scope constexpr variables and constexpr static data members in device compilation. Differential Revision: https://reviews.llvm.org/D79237 |
||
---|---|---|
.. | ||
Inputs | ||
address-spaces.cu | ||
alias.cu | ||
amdgpu-hip-implicit-kernarg.cu | ||
amdgpu-kernel-arg-pointer-type.cu | ||
amdgpu-kernel-attrs.cu | ||
amdgpu-visibility.cu | ||
amdgpu-workgroup-size.cu | ||
builtins-amdgcn.cu | ||
constexpr-variables.cu | ||
convergent.cu | ||
cuda-builtin-vars.cu | ||
debug-info-address-class.cu | ||
debug-info-template.cu | ||
deferred-diag.cu | ||
dependent-libs.cu | ||
device-init-fun.cu | ||
device-stub.cu | ||
device-var-init.cu | ||
device-vtable.cu | ||
filter-decl.cu | ||
flush-denormals.cu | ||
fp-contract.cu | ||
function-overload.cu | ||
kernel-amdgcn.cu | ||
kernel-args-alignment.cu | ||
kernel-args.cu | ||
kernel-call.cu | ||
kernel-dbg-info.cu | ||
kernel-stub-name.cu | ||
launch-bounds.cu | ||
library-builtin.cu | ||
link-device-bitcode.cu | ||
llvm-used.cu | ||
ms-linker-options.cu | ||
norecurse.cu | ||
nothrow.cu | ||
openmp-target.cu | ||
printf-aggregate.cu | ||
printf.cu | ||
propagate-metadata.cu | ||
ptx-kernels.cu | ||
surface.cu | ||
texture.cu | ||
types.cu | ||
unnamed-types.cu | ||
usual-deallocators.cu |