[PATCH] D69129: [AMDGPU] Fix assertion due to initializer list

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 17 11:58:49 PDT 2019


yaxunl created this revision.
yaxunl added a reviewer: rjmccall.
Herald added subscribers: t-tye, tpr, dstuttard, wdng, kzhuravl.

Sometimes a global var is replaced by a different llvm value. clang use GetAddrOfGlobalVar to get the original llvm global variable.
For most targets, GetAddrOfGlobalVar returns either the llvm global variable or a bitcast of the llvm global variable.
However, for AMDGPU target, GetAddrOfGlobalVar returns the addrspace cast or addrspace cast plus bitcast of the llvm global variable.
To get the llvm global variable, these casts need to be stripped, otherwise there is assertion.

This patch fixes that.


https://reviews.llvm.org/D69129

Files:
  lib/CodeGen/CodeGenModule.cpp
  test/CodeGenCXX/cxx11-extern-constexpr.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69129.225486.patch
Type: text/x-patch
Size: 7123 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191017/fcec4b97/attachment.bin>


More information about the cfe-commits mailing list