[HLSL][Sema] Reject unsupported vector swizzles (#225286)
fixes #216199
This started out as rejecting swizzles for long vectors. But it turns
out we did not remove opencl accessors so this change also does that.
HLSL vector swizzles are limited to the xyzw and rgba component sets and
vectors of up to four elements.
[AMDGPU] Add `getLDSEncodingGranule` to TargetParser (#224852)
Model LDS encoding granularity with dedicated features and expose the
byte-valued `getLDSEncodingGranule` query for GPUKind and subarch.
Migrate program resource register and PAL metadata encoding to the new
query and remove `getLdsDwGranularity` from `AMDGPUBaseInfo`
---
This PR is inspired by https://github.com/llvm/llvm-project/pull/219495.
> The AMDGPU backend uses the wrong LDS allocation granularity when
computing occupancy for RDNA 2 targets starting from GFX10.3. The
current value is correct for the PAL metadata, but leads to wrong
occupancy calculations as observed by users.. The values correspond to
the Mesa implementation, see
https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/amd/common/ac_shader_util.h#L355.
[Offload] Use LLVM likely/unlikely macros (#224716)
This is an additional patch to #224047, which makes the offload
components buildable with relatively old c++17-supporting compilers.
[MLIR][TOSA] Enable strict property assembly format (#217291)
Enable strict properties-in-assembly-format mode for TOSA. Bind TOSA
operation properties directly in declarative assembly formats so strict
parsing does not rely on property dictionaries.
Update the TOSA tests to use the direct property spelling.
Assisted-by: Codex
[clang][CIR] Stop using Operation::getAttrs (NFC) (#223048)
Migrate CIR printing, attribute copying, and lowering to the explicit
inherent and discardable attribute APIs.
This is part of a general migration to use the "new" properties-based
APIs and stop mixing discardable/inherent attributes, see #155475
Assisted-by: Codex
[TLI][Darwin] Add mappings for 16 more libsystem_m vector functions (#224792)
The Darwin_libsystem_m veclib table mapped 17 of the 38 stems exported
by libsystem_m.dylib. This adds 16 more, in both VecFuncs.def and the
DARWIN_LIBSYSTEM_M_VECFUNCS defset, bringing it to 33.
The remaining 5 are round, fma, fmod, sincos and sincospi; see #223283
for why each is skipped or deferred.
Fixes #223283
[LiveDebugVariables] Repair stale SlotIndexes
The analysis keeps its indexes from before the first register allocator
until DBG_VALUEs are emitted, by which point passes in between have
erased some of the instructions they point at. Resolve them at the
start of each allocator run and before emitting.
SlotIndexes can then reclaim the entries of erased instructions without
sparing the ones held here, which would have made generated code depend
on -g. Emitted locations are unchanged, except that intervals resolving
to one position now emit a single DBG_VALUE rather than identical
consecutive ones.
[SlotIndexes] Add queries for stale indexes
An erased instruction leaves its index list entry in place, making the
index indistinguishable from a block boundary entry. Add
isBlockBoundaryIndex() and isStaleIndex() to tell the two apart, and
canonicalizeIndex() to resolve a stale index to the closest preceding
instruction's register slot, or the block start if none survives.
NFC. No caller yet. LiveDebugVariables is next.
[VPlan] Add more generic VPCostContext::getCostDivisor (NFC). (#225413)
Replace getReplicateRegionCostDivisor with more general getCostDivisor,
which takes a frequency directly.
The frequency lookup is now done at the 3 call sites, which all have the
region at hand.
Will also be used in https://github.com/llvm/llvm-project/pull/196845.
PR: https://github.com/llvm/llvm-project/pull/225413
SelectionDAG: Don't pad the source of ADDRSPACECAST if it's legal. (#225390)
With this use case `%out = addrspacecast <2 x ptr> %in to <2 x ptr
addrspace(1)>` on z/OS, the res type is `v2i32` (illegal) and the source
type is `v2i64` (legal).
Padding the source up to `v4i64` makes it illegal on z/OS and breaks the
type legalization.
[GitHub] Avoid downloading outputs during Bazel tests when possible (#224725)
PR adds
[`--remote_download_outputs=minimal`](https://bazel.build/reference/command-line-reference#param-remote-download-outputs-1)
to bazel tests in CI. I noticed recently that `Bazel Build/Test` takes
~2m to run even when everything is cached. It looks like it's
downloading ~1GiB of artifacts from the remote cache. For example, in [a
recent
run](https://github.com/llvm/llvm-project/actions/runs/35147456695/job/104967035656):
```
[82,641 / 90,341] 1094 / 7245 tests; Linking external/+_repo_rules+llvm-project/flang/lib/Semantics/libFortranSemantics.a; Downloading external/+_repo_rules+llvm-project/flang/lib/Semantics/libFortranSemantics.a, 260.4 MiB / 288.7 MiB; 1s remote-cache ... (62 actions, 10 running)
[88,426 / 91,191] 1238 / 7245 tests; Linking external/+_repo_rules+llvm-project/mlir/mlir-reduce; Downloading external/+_repo_rules+llvm-project/mlir/mlir-reduce, 337.0 MiB / 344.6 MiB; 13s remote-cache ... (58 actions, 0 running)
[88,870 / 92,185] 1315 / 7245 tests; Linking external/+_repo_rules+llvm-project/mlir/mlir-query; Downloading external/+_repo_rules+llvm-project/mlir/mlir-query, 241.9 MiB / 264.2 MiB; 11s remote-cache ... (55 actions, 0 running)
...
Executed 0 out of 7245 tests: 7245 tests pass.
```
Using this flag saves ~20-30s on my machine. After this PR, the majority
[3 lines not shown]
[llvm] Remove declarations without definitions (NFC) (#225320)
DataRecordHandle::create and DataRecordHandle::construct in
llvm/lib/CAS/OnDiskGraphDB.cpp: The unused definitions were removed on
November 24, 2025 in commit f21857313dfab543e66ef43b1aed43b685794a7c.
dwarf_linker::parallel::DwarfEmitterImpl::emitStringsImpl in
llvm/lib/DWARFLinker/Parallel/DWARFEmitterImpl.h: Added on May 20, 2023
in commit 5f2a7fa67e9b6081a1a750ecea1216d53287eaa0 without a definition
or any callers (only DWARFLinkerImpl::emitStringsImpl was defined).
dwarf_linker::parallel::SyntheticTypeNameBuilder::addOrderedName
(2-argument overload) in
llvm/lib/DWARFLinker/Parallel/SyntheticTypeNameBuilder.h: Added on
November 23, 2023 in commit b61ac4a88f934ab5c02ee2a4957fb1b9943e7a5d
without a definition or any callers.
pdb::GSIHashStreamBuilder::finalizePublicBuckets and
pdb::GSIHashStreamBuilder::finalizeGlobalBuckets in
[42 lines not shown]
[mlir][arith] Add minimumnumf and maximumnumf operations (#221658)
Add `arith.minimumnumf` and `arith.maximumnumf`, following
`minimumNumber` and `maximumNumber` from IEEE 754-2019 and the
`llvm.minimumnum`/`llvm.maximumnum` intrinsics. They differ from the
existing `arith.minnumf`/`arith.maxnumf` only in their treatment of
signaling NaNs: the new ops deterministically return the non-NaN
operand, whereas minnumf/maxnumf may return either NaN or the other
operand.
[CIR] Don't delete 'sub' op during 'convertToIndexTy' (#225231)
This showed up in a SPEC benchmark: IF that sub operation is still being
used, deleting it causes us to orphan its other uses, causing a
conversion failure. We can't actually delete it, as we have no way of
knowing whether it has other uses (since we're in the process of
removing at least one of its uses?). SO this patch is going to just
count on dead-code elemination to remove this sub after we stop using
its value, if at all possible.
[lldb][NFC] Move XcodeSDK's sysroot into a separate XcodeSDKAndSysroot class (#224361)
`XcodeSDK` carried two unrelated things: the SDK identity parsed out of
an SDK directory name (`"MacOSX14.0.sdk"`), and the sysroot the compiler
recorded in `DW_AT_LLVM_sysroot`. The second is an absolute path on the
build machine and is only there when the SDK was read out of debug info.
Callers have no way to tell the two states apart.
This patch splits out `XcodeSDKAndSysroot`, which groups an `XcodeSDK`
with its sysroot. `XcodeSDK` keeps only the parsed SDK name, so
`XcodeSDK::Merge` no longer touches a sysroot.
`XcodeSDKAndSysroot::Merge` does that instead.
It follows the rules below:
- When the other SDK wins the merge, its sysroot comes with it.
- When merging only adds the `Internal` suffix to our own SDK name, the
sysroot is renamed alongside it, unless it does not name an SDK
[2 lines not shown]