From f4d8b8781de9b0efbaf79621ff66c16964bb1df2 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Tue, 14 Feb 2023 10:37:46 -0500 Subject: [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 --- clang/lib/CodeGen/CodeGenModule.cpp | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 71a2f61ea955..90c9df4ea442 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -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 != -- cgit v1.2.3