[llvm-readobj][NFC] Use compact enum for ELFDumper (#206306)
This is the last user of EnumEntry. Migrate to compact enums to avoid
relocations for faster startup and reduced binary size.
[Support] Make format_object non-virtual (#206319)
Currently, format_object creates a 32B vtable for every instantiation.
This is costs space and dynamic relocations. Make format_object
non-virtual and adapt the two printing users to use a function_ref
instead.
[TableGen] Use StringTable for searchable tables (#206252)
LLVM has some large searchable tables containing string pointers. This
patch changes two things:
- String references in searchable tables are now always StringTable
offsets; and all code referencing these is updated accordingly. This
often avoids relocations in the data structures, permitting their
placement in .rodata instead of .data.rel.ro and avoids dynamic
relocations.
- The lookup indicies now reference the same string table instead of
storing string pointers, permitting deduplication and also avoids
dynamic relocations.
In an all-target assert build, this changes section sizes as follows:
- .data.rel.ro: -311920
- .rodata: +227712
[6 lines not shown]
AMDGPU: Replace tgsplit subtarget feature with attribute
This is a per-entrypoint property and has a corresponding
assembler directive, so it should not be baked into the
subtarget. I couldn't find much documentation on what this
actually does, so the description isn't great.
Fixes #204149
Co-authored-by: Claude Opus 4.6 <noreply at anthropic.com>
[AArch64][NFC] Use compact enum table for feature strings (#206084)
Although this is not exactly an enum, the same data structure can be
used to compactly store the feature strings without dynamic relactions.
As a side effect, this also slightly reduces the size of the table.
[llvm-readobj][NFC] Use compact enums (except for ELF) (#206075)
In principle straight-forward replacement, but clang-format is
deliberately non-helpful here..
ELFDumper is a separate patch due to the size of the changes.
[X86][NFC] Use compact enum to store ternlog comments (#206089)
Instead of storing a StringRef (StringLiteral is essentially a
StringRef) with 16 bytes and one dynamic relocation for each of the 256
entries (4kiB total) and, use the new compact enum tables to store each
entry with 4 bytes and without relocations.
[clang-tidy] Fix invalid avoid-c-style-cast fix-it after keywords (#206239)
When a C-style cast immediately follows an identifier-like token, the
replacement could merge with the previous token, e.g. turning
`return(int)d` into `returnstatic_cast<int>(d)`. This patch fixes the
problem by adding a leading space to the replacement when needed.
Closes https://github.com/llvm/llvm-project/issues/97012
[FileCheck] Call out var captures on unmatched patterns
This patch is motivated by an #llvm IRC chat in 2019 with Aaron
Ballman, where he pointed out an example similar to following:
```
$ cat input
[[clang::optnone]] void foo() {
$ cat check
CHECK: [[clang::optnone]] void foo() {
$ FileCheck check < input |& tail -7
Input was:
<<<<<<
1: [[clang::optnone]] void foo() {
check:1'0 { } search range (exclusive bounds)
check:1'1 error: no match found
check:1'2 ? possible intended match
[21 lines not shown]
[Allocator] Drop RedZoneSize (non-sanitizer) and BytesAllocated members (#205711)
`RedZoneSize` is only read inside `#if LLVM_ADDRESS_SANITIZER_BUILD`.
Additionally gate it under `LLVM_ENABLE_ABI_BREAKING_CHECKS` so that
release-non-assertions builds don't incur the overhead. To support
non-asan build with asan library users, the variable is only omitted in
`!LLVM_ENABLE_ABI_BREAKING_CHECKS` builds.
`BytesAllocated` is incremented on every Allocate (a hot-path memory
read-modify-write) only to back `getBytesAllocated()`. Drop the member.
There is a measurable stage2 instruction-count reduction.
https://llvm-compile-time-tracker.com/compare.php?from=25a6b5be6853b2c493ef392d41e43dd35ad4839a&to=8ebc975635ad717deb392d20b50f1a1f6bb16054&stat=instructions:u
Migrate the in-tree consumers:
- TableGen dumpAllocationStats drops the line; the clangd debug log
reports
getTotalMemory().
[8 lines not shown]
[mlir-c] Add IRMapping C API bindings (#206146)
Expose IRMapping through the MLIR C API with full create/destroy/map, lookup, contains/erase, and clone-with-mapping functionality.
Assisted by: Claude