[HIP] Make sure, unused hip-pinned-shadow global var is kept within device code
authorhsmahesha <mahesha.comp@gmail.com>
Wed, 4 Mar 2020 05:23:32 +0000 (10:53 +0530)
committerhsmahesha <mahesha.comp@gmail.com>
Wed, 4 Mar 2020 05:24:26 +0000 (10:54 +0530)
commitcac068600e55e489844156d3581b61eeecee7d4e
tree4ec6fb5217518f87962b7594ef4b08d6275e1a64
parent952ad4701cf0d8da79789f6b83ddaa386c60d535
[HIP] Make sure, unused hip-pinned-shadow global var is kept within device code

Summary:
hip-pinned-shadow global var should remain in the final code object irrespective
of whether it is used or not within the code. Add it to used list, so that it
will not get eliminated when it is unused.

Reviewers: yaxunl, tra, hliao

Reviewed By: yaxunl

Subscribers: hliao, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D75402
clang/lib/CodeGen/CodeGenModule.cpp
clang/lib/CodeGen/CodeGenModule.h
clang/test/CodeGenCUDA/hip-pinned-shadow.cu