[libc] Fix move destruction double-freeing ports after move to RAII
Summary:
Recently I changed the interface to use RAII to close the ports. This
exposed a problem where the default move constructor was invoked in the
optional wrapping, this caused the destructor to fire twice on the
server, obviously causing havok. This PR changes the move destructor to
be deleted so this never happens again. Now everything is constructed
once and only references are allowed. The optional class had to be
fixed to properly set in_use so we run the destructor properly as well.
[lldb] Add tree-sitter based Swift syntax highlighting (#181297)
This adds tree-sitter based Swift syntax highlighting to LLDB. It
consists of the SwiftTreeSitterHighlighter plugin and the vendored Swift
grammar [1], which is licensed under MIT.
[1] https://github.com/alex-pinkus/tree-sitter-swift
[AArch64][GlobalISel] Reassociate add sub mul. (#180753)
This is a port of performSubAddMULCombine from D143143. The mid end will
reassociate sub(sub(x, m1), m2) to sub(x, add(m1, m2)). This
reassociates it back to allow the creation of more mls instructions.
[libc++] Memoise `size()` in `vector::__assign_with_size` (#180288)
This is an optimisation from the size-based vector project that's
applicable to all vector implementations.
[Polly][ScopInfo] Lazy Scop instantiation (#179535)
The old NPM was using ScopInfo pass introduced in
https://reviews.llvm.org/D20962, which in contrast to the LPM was using
ScopInfoRegionPass. ScopInfo was instantiating all Scop objects
immediately. After codegenning, all Scop objects need to be recomputed
anyway, making this approach wastful. The PhaseManager inherited this
behaviour from the NPM, leading to some concerns.
Replace the instantiate-all behavior of ScopInfo with an on-demand
instantiation. SCoPs now must be iterated using ScopDetection instead
using ScopInfo, but only some unsed legacy NPM passes (now removed) were
doing that anyway.
[ELF] Add target-specific relocation scanning for Hexagon (#181596)
Implement Hexagon::scanSectionImpl, following the pattern established
for x86 (#178846) and PPC64. This merges the getRelExpr and TLS handling
for
SHF_ALLOC sections into the target-specific scanner, enabling
devirtualization and eliminating abstraction overhead.
- Inline relocation classification into scanSectionImpl with a switch
on relocation type, replacing the generic rs.scan() path.
- Use processR_PC/processR_PLT_PC for common PC-relative and PLT
relocations.
- Handle GD PLT relocations inline, always setting NEEDS_PLT. Remove
the R_HEX_GD_PLT special case from process().
- Handle TLS IE, GD GOT, and TPREL directly, bypassing
handleTlsRelocation. Remove EM_HEXAGON from the execOptimize check.
- Simplify getRelExpr to only handle relocations needed by
relocateNonAlloc and scanEhSection.
[X86] Correctly call 16 byte atomic helpers on x86_64 Windows (#181356)
On x86_64 Windows, i128 values are returned in xmm0, and as arguments to
functions, they are passed indirectly (rather than in a GPR pair) - see
WinX86_64ABIInfo::classify in Clang [1].
When AtomicExpandPass generates a libcall, it normally generates one
with i128 arguments and return types. This type isn't lowered correctly
(it ends up passed or returned in a pair of GPRs).
To fix this issue, make AtomicExpandPass use the v2i64 type instead of
i128 here, just like Clang would do for an explicit function call; this
type ends up lowered correctly.
This fixes https://github.com/mstorsjo/llvm-mingw/issues/538 and
https://github.com/llvm/llvm-project/issues/136428.
[1]
https://github.com/llvm/llvm-project/blob/llvmorg-21.1.8/clang/lib/CodeGen/Targets/X86.cpp#L3390-L3408
[SLP]Fix revec in split nodes
Initially split nodes do not support vector entries in revec mode, patch
fixes the issue by adding analysis for the scale factor
Fixes #181546
[clang][ssaf] Add EntityLinkage data structure (#181718)
This commit introduces the `EntityLinkage` class to represent the
linkage properties (`None`, `Internal`, `External`) of entities in the
SSAF framework and integrates it into the `TUSummary` class to enable
tracking this information across translation units.
rdar://162571047
Assisted-By: Claude
[CI][ScriptedBuilder] Avoid python 3.12-only option (#181746)
The shutil.rmtree(onexc=) parameter was only added in Python 3.12. Use
onerror= instead whose callback signature takes a different third
parameter which is ignored anyway.
[llvm][clang] Revert split stacks implementation from runOnNewStack (#181743)
This was potentially causing Clang to emit out of stack space warnings
in rare cases, so I'm reverting it until I can verify the issue. This
keeps the API change as that's known not to be the issue.
[NFC][CodeGen] Minor code cleanup in MIR FrameIndex verification (#181551)
Use variable names conforming to LLVM CS and shorten the code a bit
using `dyn_cast_if_present`.
[AArch64][llvm] Remove +cmh gating (#181662)
Remove gating of `shuh` and `stcph` since these are instructions from
the HINT space, and therefore is a NOP on cores that don't implement it,
so gating is superfluous. gcc doesn't gate these, so remove for better
compatibility.
[libc] Replace RPC 'close()' mechanism with RAII handler (#181690)
Summary:
Closing ports was previously done manually, This makes the protocol more
error prone as unclosed ports will leak and eventually the locks will
run out. I believe the original fear was that the RAII portion would
negatively impact code generation but I have not noticed anything
significant.
[clang][ssaf] Implement JSONFormat (#180021)
This PR implements JSON serialization and deserialization support for
SSAF. To enable error reporting, the interface of `SerializationFormat`
APIs has been updated to return `llvm::Expected`. Error messages
produced by the `JSONFormat` implementation include multiline context
indicating the _conceptual_ path that led to the failure.
rdar://168770769
rdar://168929437
Assisted-By: claude
[VPlan] Skip gather/scatters in useEmulatedMaskMemRefHack.
The legacy cost model skips gather/scatters when determining the
predicated stores in useEmulatedMaskMemRefHack. Match the behavior in
the VPlan-based implementation. This fixes a cost divergence in the
attached test.
[mlir][AMDGPU] Update gather_to_lds with explicit-async support (#181082)
This commit takes advantage of the new `load.async.to.lds` intrinsic in
order to add an `async` mode to `gather_to_lds`. In this mode,
completion of the load needs to be managed with `asyncmark` and
`wait.asyncmark` intrinsics instead of being implicitly derived by alias
analysis.
This commit adds the flag, a lowering for it, and updates tests.
Co-authored-by: Claude Opus 4.5 <noreply at anthropic.com>
[mlir][ROCDL] Add async variants of pre-gfx12 LDS load intrinsics (#181072)
These are MLIR wrappers around #180466.
Co-authored-by: Claude Opus 4.5 <noreply at anthropic.com>