[DWARFLinker] Intern referenced types in synthetic names (NFC) (#237080)
The parallel linker keys each type by a synthetic name that embeds the
full names of its parent and of every type it refers to. When linking
dsymutil, 77% of the 33.8 GB of keys inserted into the type pool are
copies of parent names.
Refer to a parent or referenced type by a NUL byte followed by its
interned TypeEntry pointer instead. Keys are interned, so equal pointers
mean equal keys. Unassigned names are interned too, so they can be
referred to. This cuts the key bytes hashed and compared from 33.8 GB to
7.0 GB.
A new TypeKey class owns the encoding. The name builder appends text and
references to it, and the comparator reads keys back as text runs and
references.
The type compile unit is sorted by key, so compare keys as if every
reference were expanded, which preserves the output order. That
[9 lines not shown]
Attributor: Reach fixpoint in AACallEdges if there are only direct calls (#232617)
The callees when there are only direct, live calls will not change.
No other attributes matter, but this ran the update a second time to
find out.
Instructions spent in amdgpu-attributor:
rocPRIM test_device_scan, gfx942: 1265M -> 1263M (-0.2%)
Blender Cycles HIP kernel, gfx1100: 488M -> 487M (-0.2%)
rocPRIM 16 tests, full LTO, closed world: 4381M -> 4359M (-0.5%)
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
Attributor: Don't create call site AACallEdges for direct calls (#232616)
AACallEdgesFunction created an AACallEdges for every call-like
instruction in the function including intrinsics. For a direct call
without callback metadata, the call site attribute only ever adds the
callee, so add it directly.
Instructions spent in amdgpu-attributor:
rocPRIM test_device_scan, gfx942: 1963M -> 1768M (-9.9%)
Blender Cycles HIP kernel, gfx1100: 636M -> 622M (-2.2%)
rocPRIM 16 tests, full LTO, closed world: 7415M -> 6511M (-12.2%)
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Describe vector FuncArgTypes by element type and count
Define the vector libcall argument types from an element type and
count. Derive the matching integer and mask vector types from them
instead of spelling each one out.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Use element alignment for vector libcall out pointers
The pointer arguments of the vector modf, sincos and sincospi functions
are linear pointers to the scalar element type (e.g. the l4 in
_ZGVnN4vl4l4_sincosf), not pointers to the vector type. Only the element
alignment is guaranteed, so stop declaring them with the ABI alignment
of the vector.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Use the correct target C long width for Long
Long and ULong were mapped to the int width, which is wrong on LP64
targets (e.g. scalbln was declared taking i32 on x86_64 linux) and on
16-bit targets where long is 32 bits.
Also fix strtoul, strtoull, and the unsigned long operator new/delete
variants to use the unsigned types.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Add signatures for more runtime functions
Add type missing signatures for assorted functions which were missing
type information.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Add signext/zeroext attributes to libcall signatures
Try to match TargetLibraryInfo's behavior. Integer types narrower than
int are extended according to their signedness.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[MLIR][Python] Release GIL during long-running operations. (#236861)
Made changes to release the GIL during some potentially long-running
operations. These are running a pass manager and creating an execution
engine. Because these may call back to Python, several changes had to be
made to re-acquire the GIL at certain points.
Fixes https://github.com/llvm/llvm-project/issues/236564.
These changes were made with the help of AI. I used it to help analyze
the code for thread safety issues and to help find where the GIL would
need to be re-acquired. I also used it to help write the code.
Co-authored-by: Maksim Levental <maksim.levental at gmail.com>
SPIRV: Don't define named AccessQualifier records
The AccessQualifier records ReadOnly and WriteOnly were never
referenced by name and collide with the attribute names in
Attributes.td. It happens the backend doesn't include that today but
I'm planning on changing that.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DirectX: Avoid DXIL op attribute record name collision (#237585)
The DXIL attributes were defined with names colliding with the normal
definitions in Attributes.td. It just happens that isn't included by
the backend today, but I am planning on changing that. Add a prefix
and add an explicit name field so the generated names don't change.
Alternatively it might be possible to specify these directly with the
attribute intrinsic properties.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[libc++][pstl] Add serial implementations of std::inclusive_scan and std::transform_inclusive_scan (#236219)
This PR adds serial implementations of the inclusive scan operations to
PSTL.
Within this patch they are added only to the serial backend, such that
any other backend can fall back to these implementations.
A real parallel implementation is intended to land within the `statpart`
backend later, which will be a purely additive change, it will not touch
the code in this PR.
These are the added scan operations:
- `std::inclusive_scan` (3 variants)
- `std::transform_inclusive_scan` (2 variants)
Part of #99938.
---------
Co-authored-by: PaulXiCao <paulxicao7 at gmail.com>
[X86] LowerRotate - remove unnecessary bitwidth checks from splat amount case. NFC. (#237583)
We only accept vXi8/vXi16/vXi32 types at this point so this check is redundant.
[Offload][AMDGPU] Roll back failed stream operations
If an HSA operation fails, rollback and release the signal to avoid the
situation where something is waiting on the completion signal forever.
Claude assisted with this patch.
[libc++][ranges] Implement LWG3797: `elements_view` insufficiently constrained (#236930)
Require `std::get<N>(t)` to be valid in `has-tuple-element`. Previously,
a range of `subrange`s over a move-only iterator satisfied the
constraints of `elements_view<V, 0>` and then failed with a hard error,
because `subrange`'s lvalue `get<0>` requires `copyable<I>`.
Fixes #189811
DirectX: Give DXIL op attribute records a Name field
The DXIL attributes were defined with names colliding with the normal
definitions in Attributes.td. It just happens that isn't included by
the backend today, but I am planning on changing that. Add a prefix
and add an explicit name field so the generated names don't change.
Alternatively it might be possible to specify these directly with the
attribute intrinsic properties.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[ci] Fix LNT submission when a single artifact is downloaded (#237584)
When the artifact pattern matches a single artifact, download-artifact
extracts it directly into the target directory instead of a subdirectory.
This means a glob like `reports/*/*.json` doesn't match. To fix this,
use a glob for both `reports/*/*.json` and `reports/*.json`.
TableGen: Don't distinguish intrinsic function attribute sets by hasSideEffects (#237501)
hasSideEffects does not contribute to the emitted function attributes,
so including it in the uniquing key emitted duplicate attribute sets.
This removes 17 redundant function attribute sets, which also shrinks
the function attribute set ID from 8 to 7 bits.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[Support] Delete copy constructor in SourceMgrDiagnosticVerifier (#236962)
When building LLVM as a DLL on Windows, MSVC attempts to instantiate
implicit members such as the copy constructor. This class is already not
copyable due to having a `unique_ptr` member, so explicitly mark the
copy constructor and copy assignment operator as deleted.
The effort to build LLVM as a dylib is tracked in #109483.
[AssumeBundleQueries] Remove getKnowledgeFromUse (#237174)
The function is used only in a single place, where inlining the function
allows simplifying the code quite a bit.
[libc++] Download LNT series incrementally when selecting refinement commits (#237566)
Selecting refinement commits requires downloading a large amount of data
from LNT (the time series for all tests). When done repeatedly, this
drains the credits we have for the datanase's IO. Instead, cache the
data we've already downloaded and download only what's missing.
Assisted by Claude
[CodeGen][MachineOutliner] Ignore debug instructions when checking pa… (#227971)
…tchable exits
isMBBSafeToOutlineFrom checks the instruction before a return for
PATCHABLE_FUNCTION_EXIT and PATCHABLE_TAIL_CALL. A debug instruction
between the patchable instruction and the return currently hides it and
allows the block to be outlined.
Use prev_nodbg for the backward check while preserving the existing
treatment of pseudo probes. Retain the direct-adjacency coverage and add
a regression with a DBG_VALUE between PATCHABLE_FUNCTION_EXIT and RET.
Fixes #227922
Assisted-by: OpenAI Codex 5.6 Sol
Assisted-by: Claude (review)
[GlobalISel] Fixup commuted combine matching
Match the subtraction on either side of (A-C1)+C2. Check constants and
use counts through the matched operands.
Look through single-use copies when unmerging constants to avoid extra
AMDGPU materializations. Preserve shared constants and copies, physical
register copies, and constant-fold barriers.
Cover commuted subtraction and copied constants in MIR tests, and update
affected AMDGPU assembly checks.
[libc][docs] Update `index.md` for float80 and double_double functions (#236675)
This removed the long_double column, replacing it with the float80 and
double_double functions.
( Assisted using : Gemini )