[libc-commits] [libc] [libc] Update printf_core::Writer to template on character type. (PR #220669)

Michael Jones via libc-commits libc-commits at lists.llvm.org
Thu Sep 3 10:00:56 PDT 2026


michaelrj-google wrote:

The original reason that the writer was templated was because function pointers are effectively unusable on GPUs, and they would ideally have as few branches as possible even at the cost of code size. I don't know what the status of printf on GPUs is, but I'd assume the same constraints still exist. That's why we had the templates to dispatch to each option in addition to the runtime dispatch write mode.

In general this PR seems to be making two big changes and might be better split up. Templating the writer on character type and refactoring the writer to use function pointers should probably be separate.

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


More information about the libc-commits mailing list