[clang] [libc] [llvm] [libc] Implement (v|f)printf on the GPU (PR #96369)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 25 09:14:27 PDT 2024


efriedma-quic wrote:

Do we want some sort of optimization for constant printf?  99% of the time, we could parse the string at compile-time.  (This sort of optimization is common for embedded targets.)

If the format string isn't constant, is parsing the string on the GPU really slower than asking the host for the size?  printf format strings aren't that complicated, especially if you aren't actually doing the formatting.

Does this support `%n`?

https://github.com/llvm/llvm-project/pull/96369


More information about the cfe-commits mailing list