[libc] Add sys/ucontext.h header (#194329)
POSIX historically provided <sys/ucontext.h> as an alias for
<ucontext.h>. Some software still includes the sys/ path. Added the
header as a simple wrapper that includes <ucontext.h>, gated to x86_64
alongside the existing ucontext support.
[AMDGPU] Add flat variants of av.load/store.b128 intrinsics
Add llvm.amdgcn.av.flat.load.b128 and llvm.amdgcn.av.flat.store.b128
intrinsics using flat_ptr_ty, following the established flat_/global_
naming convention used by other AMDGPU intrinsics (e.g., flat_prefetch
vs global_prefetch, flat_load_monitor vs global_load_monitor).
These select to FLAT_LOAD_DWORDX4 / FLAT_STORE_DWORDX4 with the same
cache policy bits as the global variants.
Assisted-By: Claude Opus 4.6 (1M context)
[Clang][RAV] Visit components of __builtin_offsetof designators (#194122)
`RecursiveASTVisitor` previously only traversed the type operand of an
`OffsetOfExpr,` ignoring the field/identifier/base/array-index
components of the designator. This meant tools built on RAV (clang-tidy,
clangd, indexers, ...) silently missed every field reference inside
`__builtin_offsetof(T, a.b.c)`.
Add a `TraverseOffsetOfNode / VisitOffsetOfNode` pair following the same
pattern used for `ConceptReference`, `ObjCProtocolLoc`, and friends. The
`DEF_TRAVERSE_STMT` for `OffsetOfExpr` now invokes
`TraverseOffsetOfNode` for each component; array index expressions
continue to be reached via the existing children() traversal. Default
visitation is a no-op, so the change is opt-in for consumers and
behavior-preserving otherwise.
Also expose `OffsetOfNode` as a `DynTypedNode` kind via `ASTTypeTraits`
so that downstream machinery (`SelectionTree`, parent maps, matchers)
can reference these nodes uniformly.
[6 lines not shown]
[DAGcombine] Recognize fneg on RHS for partial_reduce_fmla (#193994)
PR #186809 recognized the negation on the fmul() expression, but after
instcombine the fneg is moved to the RHS operand, so with #186809 the
negation would not be recognized by the combine.
https://godbolt.org/z/YfoYshz78
[TableGen] Emit constexpr versions of some directive/clause functions
Reland https://github.com/llvm/llvm-project/pull/176253 with a change
to reduce compile-time impact.
Several of the functions that TableGen emits into the .cpp files for
OpenACC or OpenMP could be constexpr. They can't just be emitted into
the header files as constexpr as they are because they use "assert" and
"llvm_unreachable".
To preserve the existing functionality, this patch will cause TableGen
to emit the constexpr variants that return the value as std::optional,
where std::nullopt indicates an error. The exisiting functions will
invoke the constexpr versions and call assert/llvm_unreachable if
nullopt is returned. E.g.
```
// .h
constexpr std::optional<Association>
getDirectiveAssociationOpt(Directive D) {
[20 lines not shown]
[Flang][OpenMP] Allow Fortran BLOCK construct inside WORKSHARE region (#193352)
**Problem**
Flang incorrectly rejects Fortran BLOCK constructs inside OpenMP
WORKSHARE regions. This fixes the semantic check to recursively validate
the contents of BLOCK constructs instead of rejecting them.
The Fortran BLOCK construct (F2008) is a transparent scoping wrapper
that does not affect execution semantics. When a BLOCK appears inside a
WORKSHARE region, the restriction on allowed statements should apply to
the contents of the BLOCK, not the BLOCK construct itself.
**Fix**
The function CheckWorkshareBlockStmts (check-omp-structure.cpp) loops
through each statement inside a WORKSHARE region and checks if it's
allowed.
Before this fix, it only recognized:
[15 lines not shown]
[MLIR][XeGPU] Fix Layout collapse dims out of bounds (#193661)
Fix a bug in LayoutAttr::collapseDims() implementation.
---------
Co-authored-by: Claude Sonnet 4.5 <noreply at anthropic.com>
[flang][OpenMP] Frontend support for BEGIN/END METADIRECTIVE
This implements parsing of BEGIN/END METADIRECTIVE, plus a minimal
semantic check for the association of a directive in a WHEN/OTHERWISE
clauses.
The same semantic checks for the context selectors apply here as in
the case of a standalone METADIRECTIVE.
[MLIR][OpenMP] Fix sanitizer issue related to stack-to-shared pass (#194397)
The OpenMP dialect stack-to-shared pass could try to access attributes
from a deleted operation. This updates it to get that information from
the operation created to replace it.
[CodeGen] Fix incorrect index in rematerialization tracking (#194387)
When deleting the last rematerialization of a register, we should delete
the rematerializer's remat tracking map's entry that corresponds to the
index of the *original* register, not the rematerialized register.
The existing typo has no impact on correctness at the moment because
entries with rematerialized register indices are never created (so there
is nothing to erase), and having an empty set in a value does not break
any code invariant; it just wastes memory.
Assisted-by: Claude Code
[clang][Driver][BareMetal] Add profile library to the command line when needed (#191847)
Now that libclang_rt.profile.a supports bare-metal targets, follow other
drivers and add libclang_rt.profile.a in the BareMetal driver to the
command line automatically when needed, e.g. when
-fprofile-instr-generate is provided.
[SLP]Fix crash in getReorderingData on all-poison reuse-mask slice
When the reuse-shuffle mask is iterated in Sz-sized parts and a part is
entirely PoisonMaskElem, `Val` stays at PoisonMaskElem (-1) and the
subsequent `UsedVals.test(Val)` trips the SmallBitVector OOB assertion.
Bail out of reordering in that case.
Fixes #194315
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/194392
[clang-format] Recognize more braced initializers (#192299)
new
```C++
a = {x * x, x * x};
```
old
```C++
a = {x * x, x *x};
```
Fixes #57442.
The patch makes the program treat a brace following an equal sign a
braced initializer.
[30 lines not shown]
[lldb-server] Implement support for MultiBreakpoint packet
This is fairly straightforward, thanks to the helper functions created
in the previous commit.
https://github.com/llvm/llvm-project/pull/192910
[flang][semantics][openacc] Allow collapse clauses on do concurrent (#192488)
This PR generalizes the semantic checking for collapse clauses to work
on `do concurrent` and fixes two bugs exposed along the way:
- The first was that `collapse (n)` where n < the number of nested loops
was giving an assertion violation.
- The second was do concurrent index variables were causing an assertion
violation because they hadn't been declared before looking them up.
The lowering is implemented as a TODO which will happen in a following
diff.
[lldbremote][NFC] Factor out code handling breakpoint packets (#192915)
This commit extracts the code handling breakpoint packets into a helper
function that can be used by a future implementation of the
MultiBreakpointPacket.
It is meant to be purely NFC.
There are two functions handling breakpoint packets (`handle_Z` and
`handle_z`) with a lot of repeated code. This commit did not attempt to
merge the two, as that would make the diff much larger due to subtle
differences in the error message produced by the two. The only
deduplication done is in the code processing a GDBStoppointType, where a
helper struct (`BreakpointKind`) and function
(`std::optional<BreakpointKind> getBreakpointKind(GDBStoppointType
stoppoint_type)`) was created.
The following PRs are related to the MultiBreakpoint feature:
[7 lines not shown]
[Clang] fix parser recovery for invalid static_assert string messages (#187859)
Fixes #187690
---
This PR fixes parser recovery for invalid `static_assert` declarations
with string literal messages. The parser now stops the message lookahead
on `;` and `eof`, so invalid inputs are diagnosed as parse errors.
[FunctionAttrs] Remove declaration check lines (NFC) (#194384)
These are annoying, because they get dropped by UTC. We're not
inferring attributes on declarations anyway.