[all-commits] [llvm/llvm-project] 2a9afd: [clang] Reduce the size of ParsedAttributesView an...
Haojian Wu via All-commits
all-commits at lists.llvm.org
Tue Jul 15 04:44:11 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 2a9afdb7937710a4af5ebe5ab3a4fdd235fbf08e
https://github.com/llvm/llvm-project/commit/2a9afdb7937710a4af5ebe5ab3a4fdd235fbf08e
Author: Haojian Wu <hokein.wu at gmail.com>
Date: 2025-07-15 (Tue, 15 Jul 2025)
Changed paths:
M clang/include/clang/Sema/ParsedAttr.h
Log Message:
-----------
[clang] Reduce the size of ParsedAttributesView and AttributePool (#148726)
These objects are used as local stack variables during parsing, and they
are not small. This patch reduces their sizes:
* `ParsedAttributesView`: 72 → 40 bytes
* `AttributePool`: 72 → 40 bytes
No negative performance impact has been
[observed](https://llvm-compile-time-tracker.com/compare.php?from=a709621cd545b061782b03136286227867b452a6&to=f50500b3c178e97c0c861301e853e6d5b859040b&stat=instructions:u).
**Context:**
We have some verilator-generated code with extremely deep nesting of
parenthesized expressions, e.g.:
```cpp
bool s =
(...(bool)(i[0])
|(bool)(i[1]))
|(bool)(i[2]))
| ...
|(bool)(i[n]));
```
Before this patch, on my local machine, Clang begins emitting
`-Wstack-exhausted` when `n` is 715. After the patch, that threshold
increases to `950`.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list