Prevent adding module flag amdgpu_hostcall multiple times
authorYaxun (Sam) Liu <yaxun.liu@amd.com>
Wed, 19 Jan 2022 17:19:06 +0000 (12:19 -0500)
committerYaxun (Sam) Liu <yaxun.liu@amd.com>
Wed, 19 Jan 2022 17:52:33 +0000 (12:52 -0500)
commit85c2bd2a0e0e2c1706bbf50203d5bbbeedbbd741
tree314cc450e73a8ff526527afd3ad3bcba2f4ac736
parent32842c1bc9cd82f87139141ca3f609d3a0b65136
Prevent adding module flag amdgpu_hostcall multiple times

HIP program with printf call fails to compile with -fsanitize=address
option, because of appending module flag - amdgpu_hostcall twice, one
for printf and one for sanitize option. This patch fixes that issue.

Patch by: Praveen Velliengiri

Reviewed by: Yaxun Liu, Roman Lebedev

Differential Revision: https://reviews.llvm.org/D116216
clang/lib/CodeGen/CodeGenModule.cpp
clang/test/CodeGenCUDA/amdgpu-asan-printf.cu [new file with mode: 0644]