By default clang emits complete contructors as alias of base constructors if they are the same. The backend is supposed to emit symbols for the alias, otherwise it causes undefined symbols. @yaxunl observed that this issue is related to the llvm options `-amdgpu-early-inline-all=true` and `-amdgpu-function-calls=false`. This issue is resolved by only inlining global values with internal linkage. The `getCalleeFunction()` in AMDGPUResourceUsageAnalysis also had to be extended to support aliases to functions. inline-calls.ll was corrected appropriately. Reviewed By: yaxunl, #amdgpu Differential Revision: https://reviews.llvm.org/D109707
18 lines
554 B
Plaintext
18 lines
554 B
Plaintext
// REQUIRES: amdgpu-registered-target, clang-driver
|
|
|
|
// RUN: %clang -target x86_64-unknown-linux-gnu --offload-arch=gfx906 --cuda-device-only -nogpulib -nogpuinc -x hip -emit-llvm -S -o - %s \
|
|
// RUN: -fgpu-rdc -O3 -mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false | \
|
|
// RUN: FileCheck %s
|
|
|
|
#include "Inputs/cuda.h"
|
|
|
|
// CHECK: %struct.B = type { i8 }
|
|
struct B {
|
|
|
|
// CHECK: @_ZN1BC1Ei = hidden unnamed_addr alias void (%struct.B*, i32), void (%struct.B*, i32)* @_ZN1BC2Ei
|
|
__device__ B(int x);
|
|
};
|
|
|
|
__device__ B::B(int x) {
|
|
}
|