[AMDGPU] Add per-class register stress options (#210907)
Add options -amdgpu-stress-vgpr=N, -amdgpu-stress-agpr=N, and
-amdgpu-stress-sgpr=N to limit each register class independently by
reserving registers beyond N.
[InlineSpiller] Avoid spill hoisting interference (#211809)
When hoisting spills and the source is a PHI, the "hoisted" spill may be
inserted only after the basic block prologue. This may require extending
this segment of the source value's live interval.
Abort the hoisting if this extension of the segment would interfere with
another live interval assigned to the same physical register.
Signed-off-by: Lukas Sommer <lukas.sommer at amd.com>
[SPIR-V] Guard against infinite loop in decorateUsesAsNonUniform (#208224)
Add a visited set so an SSA cycle through a loop-carried phi does not
hang the worklist walk
[SYCL] Update SYCL to use the new liboffload allocation API (#212223)
PR #209196 split host memory allocations into a dedicated API. Update
SYCL to use the new host allocation function introduced by that change.
[orc-rt] Make ThreadPoolRunner a generic task runner. (#212229)
Commit 01683dbe7e207 generalized the Session's dispatch mechanism to
hand each runner an opaque Task (move_only_function<void()>), and
simplified QueueingRunner accordingly, but failed to update
ThreadPoolRunner.
Update ThreadPoolRunner to conform to Session's dispatch requirements
and update its unit test to dispatch plain tasks rather than
wrapper-function calls.
[offload] update llvm-gpu-loader the new liboffload allocation API (#212225)
PR #209196 split host memory allocations into a dedicated API. Update
llvm-gpu-loader to use the new host allocation function introduced by
that change.
[MLIR][Linalg] Fix crash on duplicate dimensions in linalg.broadcast (#211203)
per
[#210738](https://github.com/llvm/llvm-project/pull/210738#discussion_r3622744153)
Currently, the following crashes on verification with a segfault:
```
func.func @broadcast_rank0_tensor(%arg0: tensor<i32>, %arg1: tensor<32x2xi32>) -> tensor<32x2xi32> {
%0 = linalg.broadcast ins(%arg0 : tensor<i32>) outs(%arg1 : tensor<32x2xi32>) dimensions = [0, 0]
return %0 : tensor<32x2xi32>
}
```
The verifier should reject cases like this where we have a duplicate
dimension. I've also added a couple of tests covering `linalg.broadcast`
on various input scenarios to confirm they are being handled properly.
[libc++] Inline `text_encoding` alias offset table std::count to 884 (#207471)
- Add count test to verify the exact number of aliases our table
contains
- Should reduce compile time cost of gathering that count
[clang] Fix the StringRef assertion failure for non-narrow strings. (#212108)
StringRef assertion fires up when passing wide literals to
`__builtin_nanf()`.
The patch updates the `TryEvaluateBuiltinNan` method to reject
non-narrow string literals preventing the downstream assertion failure
caused by `getString()` in cases where the user might pass a non-narrow
/ non 1 byte literal."
Fix #205306
[SPIR-V] Fix direct return of aggregate extractvalue (#209762)
SPIRVPrepareFunctions rewrites aggregate function returns to i32 value
IDs, but an aggregate extractvalue used directly by ret kept its
original type, leaving invalid IR for the verifier. Mutate the lowered
spv_extractv result when it feeds a rewritten return so the LLVM type
matches while the registry preserves the aggregate SPIR-V type.
Closes https://github.com/llvm/llvm-project/issues/208899.
Replaces https://github.com/llvm/llvm-project/pull/209027 (that PR seems
spam? although the diagnosis was largely correct)
Co-authored-by: Claude Fable 5 <noreply at anthropic.com>
[orc-rt] Add C API for Session::callController. (#212204)
Add orc-rt-c/Session.h with a C API, orc_rt_Session_callController,
wrapping the C++ Session::callController method.
AMDGPU: Start using subarch in attributor instead of subtarget
Avoid querying the subtarget for functions when the relevant
properties are known from the triple. The various subtarget
group size functions should also be decoupled from the subtarget,
but those are trickier to untangle.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
clang/AMDGPU: Stop passing redundant -target-cpu to cc1
Now that the exact target is encoded in the triple's subarch field,
-target-cpu is redundant. This avoids polluting the resultant IR with
unwanted "target-cpu" attributes. The net result is the desired codegen
when compiling libraries for a major subarch and linking it into a
program compiled for a specific arch. e.g., compiling for "gfx9-generic"
would pollute the IR with "target-cpu"="gfx9-generic", so codegen
would ultimately be performed for the generic target even after
linking into the concrete gfx9 cpu. The specialization will now be
achieved by merging the triples without the linker or optimization
passes needing to fixup function attributes.
clang: Start using new amdgpu subarch triples
Fixup invocations using --target=amdgcn + -mcpu to introduce
the subarch in the triple.
For offload toolchains, a single toolchain is constructed for the
top level amdgpu architecture, and the effective triple is used for
target specific tool invocations.
The specifics of the resource directory layout are tbd. This does
try to find resources in the subarch named directory. The paths
are searched at toolchain creation time, so that does not work
when there are multiple subarches.
Fixes #154925
[IR][NFC] Rename insertDbgValueIntrinsic -> insertDbgValue (#212151)
Rename `insertDbgValueIntrinsic` to `insertDbgValue`, which is
consistent with the other insert helpers like `insertDbgAssign`,
`insertDeclare`, etc.
Also use debug record instead of intrinsic terminology in doc comments.
[NFC][analyzer] Eliminate NodeBuilder in VisitBlockExpr (#211865)
This is part of the commit series that gradually eliminates the class
`NodeBuilder` from the analyzer engine.
This is a straightforward case where `makeNodeWithBinding` can be
clearly applied.
The node set `Tmp` was superfluous because we can directly pass the node
to `runCheckersForPostStmt` where it will be implicitly converted to a
one-element set. (There are many precedents for this.)
Also notice that we explicitly pass the `State` to `makeNodeWithBinding`
because it can be different from `Pred->getState()` (which would have
been used implicitly by the 4-argument form of `makeNodeWithBinding`.)
[InstCombine][NFC] Reorder isKnownAlways(Mask) check in foldIntrinsicIsFPClass (#212216)
Fixes #189949
The preceding mask-narrowing step already guarantees `Mask` is a subset
of `Known.KnownFPClasses` by the time the old equality check ran, so
`Mask == Known.KnownFPClasses` was already equivalent (see #190504).
This patch replaces that equality check with `Known.isKnownAlways(Mask)`
(matching the SelectionDAG equivalent's naming) and moves it before the
narrowing step, avoiding a redundant worklist re-visit.
Added a regression test in `is_fpclass.ll`.
[offload] Split olMemAlloc to separate functions (#209196)
At the previous community meeting, we agreed to introduce contexts into
the liboffload API. I also mentioned that, as part of this work, we
could split the allocation function into three separate functions, but
we did not discuss this idea in detail.
This patch only splits the allocation functions, allowing us to discuss
and agree on the proposed interface before introducing contexts into the
`olMemAlloc` API.
Once contexts are added, the device parameter will be removed from host
allocations, and the final interface would look like this:
```c
ol_result_t olMemAllocDevice(ol_context_handle_t, ol_device_handle_t, size_t, void **);
ol_result_t olMemAllocHost(ol_context_handle_t, size_t, void **);
ol_result_t olMemAllocManaged(ol_context_handle_t, ol_device_handle_t, size_t, void **);
```
[10 lines not shown]
ARM: Mark more generic libgcc functions as available
Generic libgcc/compiler-rt functions coexist with aeabi variants
(e.g., __divsi3 and __aeabi_idiv) according to my reading of the
build. At least in compiler-rt, they are aliases (such that I'm not sure
what the point of ever emitting the __aeabi name is).
They were previously removed from the available set on AEABI+AAPCS targets
to force selection of the preferred __aeabi_* variants, back when
only one implementation per libcall could be recorded.
Now that multiple implementations can be available per libcall, stop hiding
the generics and select the __aeabi_* variant explicitly as the preferred
implemntation. This reduces the number of special cases to consider for
future libcalls info improvements.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[clang] Update C++ DR status page (#212210)
On top of updating the status page, this PR updates the `latest_release`
constant to 22 and fixes a small `cwg_index.html` parsing issue that
arose during the update.
[libc++] Implement P1901R2: owner_hash and owner_equal for shared_ptr/weak_ptr (#210551)
Fixes #105372.
## Acknowledgements
Claude assisted with test development.