[clang] [llvm] [AMDGPU] Enable OpenCL hostcall printf (WIP) (PR #72556)
Vikram Hegde via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 18 04:29:50 PDT 2024
================
@@ -3616,6 +3617,12 @@ unsigned FunctionDecl::getBuiltinID(bool ConsiderWrapperFunctions) const {
if (!ConsiderWrapperFunctions && getStorageClass() == SC_Static)
return 0;
+ // AMDGCN implementation supports printf as a builtin
+ // for OpenCL
+ if (Context.getTargetInfo().getTriple().isAMDGCN() &&
+ Context.getLangOpts().OpenCL && BuiltinID == AMDGPU::BIprintf)
+ return BuiltinID;
----------------
vikramRH wrote:
I was referring to https://github.com/llvm/llvm-project/blob/3e6db602918435b6a5ac476f63f8b259e7e73af4/clang/lib/AST/Decl.cpp#L3633. This essentially means that even if frontend attaches the printf builtin ID to the decl (even after custom type checks), this would revert.
https://github.com/llvm/llvm-project/pull/72556
More information about the cfe-commits
mailing list