diff options
| author | Yaxun (Sam) Liu <yaxun.liu@amd.com> | 2021-11-10 16:55:17 -0500 |
|---|---|---|
| committer | Yaxun (Sam) Liu <yaxun.liu@amd.com> | 2021-11-10 17:05:57 -0500 |
| commit | 4b3881e9f319b6c4ec69160f16a49c128ffbd7dd (patch) | |
| tree | 49a65c434cc6570a65b86df2b3c53d9b97854dfb /clang/lib/CodeGen/CodeGenModule.cpp | |
| parent | 0242a6adf73a7cdee55e90989d1d075b607320e1 (diff) | |
Emit hidden hostcall argument for sanitized kernels
this patch - https://reviews.llvm.org/D110337 changes the way how hostcall
hidden argument is emitted for printf, but the sanitized kernels also use
hostcall buffer to report a error for invalid memory access, which is not
handled by the above patch and it leads to vdi runtime error:
Device::callbackQueue aborting with error : HSA_STATUS_ERROR_MEMORY_FAULT:
Agent attempted to access an inaccessible address. code: 0x2b
Patch by: Praveen Velliengiri
Reviewed by: Yaxun Liu, Matt Arsenault
Differential Revision: https://reviews.llvm.org/D112820
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index a4c60f0c50c2..c28c2e2e85d8 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -565,6 +565,7 @@ void CodeGenModule::Release() { "__amdgpu_device_library_preserve_asan_functions_ptr", nullptr, llvm::GlobalVariable::NotThreadLocal); addCompilerUsedGlobal(Var); + getModule().addModuleFlag(llvm::Module::Override, "amdgpu_hostcall", 1); } emitLLVMUsed(); |
