When generating llvm.used, we may need an addrspacecast instead of a bitcast.
authorJustin Holewinski <jholewinski@nvidia.com>
Mon, 2 Feb 2015 21:05:49 +0000 (21:05 +0000)
committerJustin Holewinski <jholewinski@nvidia.com>
Mon, 2 Feb 2015 21:05:49 +0000 (21:05 +0000)
commitf37f3d35eb4f3bf4a69cfc4eedaea1caa43d096c
tree6d1f2af88524a58ee1fc703c471c4748c5326cbd
parent2f746d4c943a59626925ac625583ddc081b34388
When generating llvm.used, we may need an addrspacecast instead of a bitcast.

Summary:
This is especially important for targets that use multiple address spaces,
and commonly place global variables in address spaces other than zero.

Fixes PR22383

Test Plan: New test case added: llvm-used.cu

Reviewers: jingyue

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D7345

llvm-svn: 227861
clang/lib/CodeGen/CodeGenModule.cpp
clang/test/CodeGenCUDA/llvm-used.cu [new file with mode: 0644]