llvm-project
89ea9df6 - [NFCI[TableGen] Minor improvements to `Intrinsic::getAttributes` (#152761)

Commit
129 days ago
[NFCI[TableGen] Minor improvements to `Intrinsic::getAttributes` (#152761) This change implements several small improvements to `Intrinsic::getAttributes`: 1. Use `SequenceToOffsetTable` to emit `ArgAttrIdTable`. This enables reuse of entries when they share a common prefix. This reduces the size of this table from 546 to 484 entries, which is 248 bytes. 2. Fix `AttributeComparator` to purely compare argument attributes and not look at function attributes. This avoids unnecessary duplicates in the uniqueing process and eliminates 2 entries from `ArgAttributesInfoTable`, saving 8 bytes. 3. Improve `Intrinsic::getAttributes` code to not initialize all entries of `AS` always. Currently, we initialize all entries of the array `AS` even if we may not use all of them. In addition to the runtime cost, for Clang release builds, since the initialization loop is unrolled, it consumes ~330 bytes of code to initialize the `AS` array. Address this by declaring the storage for AS using just a char array with appropriate `alignas` (similar to how `SmallVectorStorage` defines its inline elements).
Author
Parents
Loading