HomePhabricator

[AMDGPU] Fix assertion due to initializer list

Authored by yaxunl on Oct 20 2019, 8:02 AM.

Description

[AMDGPU] Fix assertion due to initializer list

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.

Differential Revision: https://reviews.llvm.org/D69129

llvm-svn: 375362

Details

Committed
yaxunlOct 20 2019, 8:02 AM
Differential Revision
D69129: [AMDGPU] Fix assertion due to initializer list
Parents
rG2779987d0e29: [yaml2obj][obj2yaml] - Do not create a symbol table by default.
Branches
Unknown
Tags
Unknown