[Offload] Report no pending work for host plugin queues (#240927)
The host plugin runs every operation synchronously, but
hasPendingWorkImpl returned true unconditionally. As a result
OL_QUEUE_INFO_EMPTY was always false on the host device, and
olDestroyQueue parked every host queue on the context's outstanding list
until the context was destroyed.
Return false instead, so a host queue reports as empty and is released
when it is destroyed. All backends now report the real queue status, so
drop the "may be unconditionally false" caveat from the
OL_QUEUE_INFO_EMPTY documentation.
Assisted-by: Claude
[lldb] Show synthetic children in the return value of the thread description (#241323)
ValueObject::Dump without options uses synthetic children only for
synthetic value objects.
assisted by claude
[CIR][NFC] Separate shared metadata lowering from OpenCL conversions (#240990)
Extract function metadata dispatch and aggregation into
`LowerToLLVMMetadata`, including the maximum work-group size conversion
introduced in #227715. Keep OpenCL-specific conversions in
`LowerToLLVMOpenCLMetadata`.
Assisted-by: Codex / GPT-6
[libc][docs] Add remaining C23 and POSIX docgen header catalogues (#241564)
Twenty-four C23 and POSIX headers currently lack docgen status
catalogues, while float.h and other freestanding headers in
CLANG_FREESTANDING_HEADERS short-circuit to implemented instead of
checking LLVM-libc's own macro and type headers. Purely compiler-owned
freestanding headers (such as stdarg.h, stdatomic.h, stddef.h, and
tgmath.h) live in Clang or GCC rather than libc, so docgen cannot
truthfully report per-symbol coverage for them.
Remove CLANG_FREESTANDING_HEADERS and provider overrides so float.h,
limits.h, stdckdint.h, and stdint.h evaluate directly against
libc/include/ (including typedefs in macro headers), note the
compiler-provided headers on libc/docs/headers/index.md, and add docgen
YAML catalogues for limits.h, stdckdint.h, stdint.h, and the 21
remaining POSIX headers.
Assisted-by: Automated tooling, human reviewed.
[lldb] Give tail call frames distinct, ordered StackIDs (#240665)
Synthesized tail call frames all had an invalid CFA, so the tail call
frames of one function shared a `StackID` and broke the order that
`StackFrameList::GetFrameWithStackID` relies on. On a stack that repeats
a tail call, `SBFrame` calls could resolve to the wrong frame, and
lookups fell back to a linear scan, making a full stack walk quadratic.
Give each tail call frame the CFA of the younger frame that replaced it,
plus a depth that orders the frames sharing that CFA. The borrowed CFA
only identifies the frame: `SBFrame::GetCFA` and `DW_OP_call_frame_cfa`
still treat it as having none.
[LoongArch][NFC] Replace manual v2i128 check with MVT::v2i128 (#241726)
Now that v2i128 is a legal MVT, the manual v2i128 check and the
associated stale comment are no longer needed. Compare against
MVT::v2i128 directly instead.
[libc][test] Fix dangling CString paths in copy_file_range_test (#241787)
Fixes the `aarch64` / overlay failure in
`libc.test.src.unistd.copy_file_range_test` introduced by #240018.
### Root Cause
1. `libc_make_test_file_path(...)` returns an owning `CString`
(non-copyable, non-movable). Storing it into `const char *in_path` /
`out_path` in `SetUp()` destroyed the temporary `CString` immediately,
leaving dangling pointers for `open()` and `unlink()` and causing
`ENOENT` in `SetUp()` (cascading into `EBADF` in `CopyNoOffsets` and
`CopyWithOffsets`).
2. `LlvmLibcCopyFileRangeTest::SetUp()` and `TearDown()` overrode
`ErrnoCheckingTest::SetUp()` / `TearDown()` without invoking the base
class methods.
### Changes
- Initialize `in_path` and `out_path` directly as fixture members using
`decltype(libc_make_test_file_path(...))` so the `CString` objects stay
[8 lines not shown]
[flang] Fix incorrect reallocation for host-associated main-program coarrays #231233 (#233361)
This fix resolves the issue #231233 involving incorrect reallocation of
a coarray when it is accessed via host association in a nested
procedure.
---------
Co-authored-by: Dan Bonachea <dobonachea at lbl.gov>
[Hexagon] Add local VTCM frames for HLX objects (#241650)
Move local HLX objects to a separate VTCM frame, address them through
VSP, and allocate and release the frame with vallocframe and
vdeallocframe.
Co-authored-by: Yashas Andaluri <yandalur at qti.qualcomm.com>
[flang][Semantics] Adding check integer kind on STAT= specifier #230463 (#231103)
This PR adds a pedantic warning to check whether the specified STAT is
an integer of at least 16-bit because
flang currently silently accepts 8-bit integers to `STAT=`: and F2023
9.7.4 says:
> R946 _stat-variable_ is _scalar-int-variable_
>
> A stat-variable should have a decimal exponent range of at least four;
otherwise the
> processor-dependent error code might not be representable in the
variable.
[SPIRV] Keep source location on OpAsmCallINTEL
insertInlineAsmProcess builds OpAsmCallINTEL with a MachineIRBuilder
whose debug location is empty.
The call therefore had no location, so the NonSemantic
debug handler emitted no debug line information.
[Clang][NFC] Re-enable consumed analysis test for chained logical OR (#240849)
Re-enable the three-way logical OR test in `testComplexConditionals1` by
removing its `#if 0` guard and stale FIXME. The operands start in the
unknown consumed state. Keep all six existing expected warnings in the
true and false branches unchanged.
Prepared with assistance from Codex.
[Clang][NFC] Re-enable local-class static member diagnostic test (#240834)
Re-enable the local-class static data member example in
`clang/test/SemaTemplate/instantiate-static-local.cpp`. Keep its
existing `expected-error {{static}}`, remove the `#if 0` guard and stale
crash FIXME, and remove the conflicting `expected-no-diagnostics`
marker.
The crash was fixed by e2def106757534b07a2d3ff15ddd48e14b69a66d
(#182707). A targeted AArch64 snapshot search followed by native X86
assertions-on builds confirms the boundary: the parent
c1c4a5a870eb668fec480771c4d002e17362ed18 crashes in
`LocalInstantiationScope::findInstantiationOf` on both attempts, while
the fix emits only the expected illegal-static-member diagnostic and
exits normally on both attempts.
Prepared with assistance from Codex.
[CIR] Use `cir.vec.fcmp` op for AArch64 builtins (#241404)
I've been splitting integer and floating comparisons and stumbled upon
these.
claude updated the test.
[libc++] Fix generator dependencies for Clang modules
Include the internal headers that declare size_t and ptrdiff_t directly so generator can use both types when building the std Clang module.
[libc] Support execution of scripts without shebangs in execvpe (#240040)
Per POSIX.1-2024, if `execve` fails with `ENOEXEC`,
`execvpe`/`execvp`/`execlp` must execute the file using the system shell
(`/bin/sh`) with the file as the first argument and the remaining
arguments appended.
### Changes
- Implements `execve_with_shell_fallback` in
`libc/src/unistd/linux/exec_utils.h`.
- Falls back to `/bin/sh` on `ENOEXEC` both for direct slash paths and
`PATH` searches.
- Adds integration tests in
`libc/test/integration/src/unistd/execlp_test.cpp`.
Fixes #232374.
[AMDGPU] Pre-commit tests for isExtractHiElt with wide sources
Add tests where the high half of a pair is selected from a source wider
than 32 bits: f16 fpext, fma_mix and D16 loads at -O0, and packed f32
broadcasts of odd elements.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[IndVarSimplify] Use context to prove a narrow IV def non-negative
When IndVars widens an IV, it checks for each narrow def
(the IV and values computed from it) whether it is
non-negative on every iteration.
If it is, zext and sext of it are equal. Then when IndVars
idens the def's users, they can choose to use either
the sext or zext of the def.
Previously, we didn't use context to prove the non-negativity of def.
Now ask SCEV about the def non-negativity at its context -
the def instruction itself.
This allows SCEV to infer facts from the dominating guards and assumes.
This in turn allows eliminating unnecessary truncs/zexts. E.g. in
if (m > 0)
[9 lines not shown]