[llvm] Fix most LLVM_ABI annotations in TableGen (#203246)
This updates most LLVM_ABI annotations in the TableGen headers to match
expected usage:
* All public APIs should be properly annotated.
* Inlined functions should not be annotated.
These changes were done by a script fixing annotations on LLVM public
headers and manually checked.
This effort is tracked in #109483.
[llvm] Fix most LLVM_ABI annotations in Frontend (#203245)
This updates most LLVM_ABI annotations in the Frontend headers to match
expected usage:
* All public APIs should be properly annotated.
* Inlined functions should not be annotated.
These changes were done by a script fixing annotations on LLVM public
headers and manually checked.
This effort is tracked in #109483.
[llvm] Fix most LLVM_ABI annotations in IR (#203244)
This updates most LLVM_ABI annotations in the IR headers to match
expected usage:
* All public APIs should be properly annotated.
* Inlined functions should not be annotated.
These changes were done by a script fixing annotations on LLVM public
headers and manually checked.
This effort is tracked in #109483.
[llvm] Fix most LLVM_ABI annotations in CAS (#203243)
This updates most LLVM_ABI annotations in the CAS headers to match
expected usage:
* All public APIs should be properly annotated.
* Inlined functions should not be annotated.
These changes were done by a script fixing annotations on LLVM public
headers and manually checked.
This effort is tracked in #109483.
[libc] Add the sockaddr_in6 type and IN6ADDR_*_INIT macros (#201357)
This patch adds struct sockaddr_in6 and the
IN6ADDR_ANY_INIT/IN6ADDR_LOOPBACK_INIT initializer macros. These are
configured to be exported via <netinet/in.h>.
I also added tests for these new features:
- layout and initialization check in test/src/netinet/in_test.cpp
verifying sockaddr_in6 size/member alignment and the in6_addr
initializer macros.
- a smoke test in test/src/sys/socket/linux/bind_test.cpp to verify
binding AF_INET6 to a localhost address. This requires a configured ipv6
stack, and may need tweaking/skipping if our build infrastructure does
not support it.
Assisted by Gemini.
[libc] Implement recvmmsg (on linux) (#202328)
The function (unlike sendmmsg) takes a timeout argument, so I make sure
to always call the version with a 64-bit time_t. I've also renamed the
sendmmsg_test.cpp unit test to sendrecvmmsg_test.cpp to test both
functions. I also updated the yaml config and docgen files to include
the new function and the struct_timespec type dependency.
Assisted by Gemini.
[Flang][OpenMP] Fix implicit symbol resolution for USE-renamed arrays (#189215)
[Flang][OpenMP] Fix USE-renamed array DSA in OpenMP regions
Problem: for a USE-renamed symbol (e.g. USE mod, ONLY: s_ary => ary),
the HostAssoc in the OMP scope was created under the original name
"ary" instead of the local alias "s_ary".
Fix: add a DeclareNewAccessEntity overload that takes an explicit
SourceName, and call it with symbol->name() (the alias) rather than
the ultimate symbol's name, so the HostAssoc is created under the
name the user wrote.
Fixes #185344
Assisted-by: Claude Sonnet 4.6
[AMDGPU] remove DefIsPriv mapping (#202694)
Since various commits that now avoid immediately casting most
temporaries, and now follow Sema for variables, this looks like tests
pass now without needing a second map to correct those issues
afterwards. Hopefully this will help find any similar remaining issues
expeditiously, if any.
[clang] `this` getter missed in ConstructAttributeList (#203010)
In https://reviews.llvm.org/D159247 (400d3261a0da56554aee8e5a2fbc27eade9d05db)
it looks intended to update all of these calls, but missed this. The
effect is that a reference `&this` in a non-zero addrspace would take
this branch and crash there (because it ends up asserting that `this`
is a pointer). DRY the code since this branch looks like it kept
getting copied more incorrectly over time. I don't have an actual use
or test for this, I just noticed it while I was trying to break other
things in fuzzing.
[docs] try again to handle doxygen everywhere (#203081)
The previous attempt at this (b7da9565017e32c18b927a7637714d1b660b558d)
still broke standalone builds. Now I have locally tested standalone
flang, runtimes (with openmp), lldb, combined builds, and the utils
script. Hopefully that covers everything this time, and gets everything
into a more consistent state (always using the HandleDoxygen script in
the same way, included exactly once as required by the cmake design).
[LoopInterchange] Consolidate induction and reduction vars check (#203197)
Previously, the handling of PHI nodes in loop headers was scattered. In
particular, there were two separate functions, `findInductions` and
`findInductionAndReductions`, which made the code difficult to reason
about. This patch consolidates these two functions, along with their
related caller logic, into a single function,
`checkInductionsAndReductions`. Although some remarks and debug outputs
have changed as a result, I believe the functionality itself remains
unchanged.
[Dexter] Write expects for variables in Debugger scopes
Following on from the previous patch, this patch adds support for writing
expects from !value/all nodes, generating separate expects for each
variable in the requested debugger scope, for each continuous range of lines
it is live for.
[LoopInterchange] Bail out when outer loop latch PHI has non-PHI user (#201923)
When there are non-PHI instructions in the outer loop that use values
originating from the LCSSA PHIs of the inner loop, it becomes difficult
to adjust the wiring during the transformation. In fact, multiple issues
(#200819 and #201571) have been raised related to this pattern. #201059
tried to resolve the issue by modifying the transformation phase, but it
was insufficient.
Instead of spending effort in the transformation phase, this patch adds
an additional check in the legality check and rejects such cases. I
think the cases rejected by this additional check are not very
practical, so the impact on realistic cases should be low, and it is
simpler than adjusting the wiring in the transformation phase.
This patch also effectively reverts #201059, as it is no longer
necessary.
Fix #201571.
[X86] Don't assert on EFLAGS copies in unreachable blocks (#203208)
X86FlagsCopyLowering collects the EFLAGS copies to lower using a
ReversePostOrderTraversal, which only visits blocks reachable from the
entry. Its end-of-pass verification, however, iterated over every block
in the function, so an EFLAGS copy left in an unreachable block (e.g.
produced by ISel for an always-taken branch whose other edge is dead)
tripped the "Unlowered EFLAGS copy!" assertion.
Such copies are harmless: the unreachable block is removed by the
unreachable-block elimination pass that runs right after this one,
before register allocation, so the copy never reaches a pass that cannot
handle it. Restrict the verification to reachable blocks (depth_first
from the entry) to match the set of blocks actually processed.
Found via fuzzing (llvm-isel-fuzzer).
[lldb-dap] Support loading core files through attachCommands (#202785)
The `attachCommands` attach option lets users bootstrap a session with
arbitrary LLDB commands, but a command that loaded a core (e.g. `target
create --core`) produced a broken session:
`ConfigurationDoneRequestHandler` would call `process.Continue()` on the
core and fail, because the non-live-session handling was keyed on the
`coreFile` attach argument rather than on the actual resulting process.
This teaches `AttachRequestHandler` to detect, after the attach commands
run, whether the selected process was loaded from a core via the
`SBProcess:: IsLiveDebugSession()` API added in #203111. When it is a
core, it sets `stop_at_entry` and clears `is_live_session`, mirroring
what the `coreFile` key does.
[StringMap] Invalidate iterators in remove() (#203249)
erase() bumps the epoch to invalidate iterators (#202237), but the
lower-level remove() — which detaches an entry without destroying it,
used
by ValueSymbolTable via Value::setName() — did not. Move the
incrementEpoch() into remove() so remove-while-iterating fails fast
under
LLVM_ENABLE_ABI_BREAKING_CHECKS too.
Aided by Claude Opus 4.8
Reland after lldb fix #203035
[mlir][LangRef] Clarify terminator continuations (#201111)
Document that terminators may have no normal control-flow continuation,
such as ub.unreachable. Also clarify that no-return calls do not remove
the structural terminator requirement.
Assisted-by: Codex
[KnownBits] Fix add() SelfAdd assertion for bitwidths >= 512 (#202769)
`KnownBits::add()` with `SelfAdd=true` lowers `X+X` to `shl(X, 1)` using
a fixed 8-bit shift amount:
```cpp
KnownBits Amt = KnownBits::makeConstant(APInt(8, 1));
return KnownBits::shl(LHS, Amt, NUW, NSW, /*ShAmtNonZero=*/true);
```
The comment there claims the shift-amount bitwidth is independent of the
source bitwidth, but that is not true: `shl()`'s `getMaxShiftAmount()`
extracts `Log2_32(BitWidth)` bits from the shift amount's max value when
`BitWidth` is a power of two:
```cpp
static unsigned getMaxShiftAmount(const APInt &MaxValue, unsigned BitWidth) {
if (isPowerOf2_32(BitWidth))
return MaxValue.extractBitsAsZExtValue(Log2_32(BitWidth), 0);
[23 lines not shown]