================
@@ -2458,6 +2458,11 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
       &getTarget().getLongDoubleFormat() == &llvm::APFloat::IEEEquad())
     BuiltinID = mutateLongDoubleBuiltin(BuiltinID);
 
+   // Mutate the printf builtin ID so that we use the same CodeGen path for
+   // HIP and OpenCL with AMDGPU targets.
+   if (getTarget().getTriple().isAMDGCN() && BuiltinID == AMDGPU::BIprintf)
+     BuiltinID = Builtin::BIprintf;
----------------
jhuber6 wrote:

I'm very close to landing 'real' printf support in the GPU libc where `printf` 
is just a regular function call. Will this change the handling for that in any 
way? I've already had to make the backend pass respect `-fno-builtins` and 
remove `ockl` from OpenMP to make that possible so I'm hoping we don't end up 
with a lot more special casing for `printf`.

https://github.com/llvm/llvm-project/pull/72554
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to