[all-commits] [llvm/llvm-project] e6125f: [AMDGPU] Fix assertion due to initializer list

Yaxun (Sam) Liu via All-commits all-commits at lists.llvm.org
Sun Oct 20 08:01:10 PDT 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: e6125fc0ec3418d6529b52f15853a06e000d478d
      https://github.com/llvm/llvm-project/commit/e6125fc0ec3418d6529b52f15853a06e000d478d
  Author: Yaxun Liu <Yaxun.Liu at amd.com>
  Date:   2019-10-20 (Sun, 20 Oct 2019)

  Changed paths:
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/test/CodeGenCXX/cxx11-extern-constexpr.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list