[AMDGPU ASAN] Remove reference to asan bitcode library

The asan functions are now attributed as used
in the device library, no need to keep the
declaration of asan device preserve function.

Patch by: Praveen Velliengiri

Reviewed by: Yaxun Liu

Differential Revision: https://reviews.llvm.org/D143495
This commit is contained in:
Yaxun (Sam) Liu
2023-02-14 10:37:46 -05:00
parent c5085c91cc
commit f4d8b8781d
2 changed files with 0 additions and 45 deletions

View File

@@ -580,20 +580,6 @@ void CodeGenModule::Release() {
EmitMainVoidAlias();
if (getTriple().isAMDGPU()) {
// Emit reference of __amdgpu_device_library_preserve_asan_functions to
// preserve ASAN functions in bitcode libraries.
if (LangOpts.Sanitize.has(SanitizerKind::Address)) {
auto *FT = llvm::FunctionType::get(VoidTy, {});
auto *F = llvm::Function::Create(
FT, llvm::GlobalValue::ExternalLinkage,
"__amdgpu_device_library_preserve_asan_functions", &getModule());
auto *Var = new llvm::GlobalVariable(
getModule(), FT->getPointerTo(),
/*isConstant=*/true, llvm::GlobalValue::WeakAnyLinkage, F,
"__amdgpu_device_library_preserve_asan_functions_ptr", nullptr,
llvm::GlobalVariable::NotThreadLocal);
addCompilerUsedGlobal(Var);
}
// Emit amdgpu_code_object_version module flag, which is code object version
// times 100.
if (getTarget().getTargetOpts().CodeObjectVersion !=