[clang] [clang] Avoid per-builtin std::string allocation in initializeBuiltins (PR #205162)

Cyndy Ishida via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 22 11:51:34 PDT 2026


cyndyishida wrote:

Attaching an isolated reproducer with a README (Claude-generated) that reports the instruction count & timing results. It builds N modules implicitly. There's about a 4% reduction with this patch applied over 50 modules loaded.
[builtins-noalloc-repro.tar.gz](https://github.com/user-attachments/files/29218891/builtins-noalloc-repro.tar.gz)

`./run.sh $LLVM_BUILD_DIR/bin/clang 50 10`

As the number of modules increases, time/instruction count % diff increases 

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


More information about the cfe-commits mailing list