[libc++][pstl] Add serial implementations of std::partial_sort and std::partial_sort_copy (#243537)
This PR adds serial implementations of the partial sorting algorithms to
PSTL.
They are added to the serial backend only, such that any other backend
can fall back to these implementations.
Currently there's no intent to provide parallel versions of these
algorithms, but later they can be added as well.
Part of #99938.
py-mercurial: update to 7.2.5.
(I couldn't get HGZSTDPOLICY=system to do anything.)
Changes in 7.2.5:
This release fixes security issues in the vendored zstd library
used by all builds and in the dependencies of the Rust extensions.
Note that some packaged versions of Mercurial use the system's
zstd, which is hopefully patched. Mercurial 7.2 added support for
HGZSTDPOLICY=system if you want to switch to the system one (see
hg help environment.HGZSTDPOLICY).
Security
Upgrade the vendored zstd to 1.6.0 for CVE-2026-124851
(62da765eb74a)
[119 lines not shown]
[CIR][OpenMP] Add support for omp single construct (#243797)
**Issue**: emitOMPSingleDirective was Not-Yet-Implemented, so #pragma
omp single hit error NYI in ClangIR codegen.
**Fix**: Lower OMPSingleDirective to omp.single, adding an emitNowait
clause emitter. allocate, copyprivate, firstprivate, and private clauses
remain NYI. Add CIR and LLVM lowering tests.
**Note**: In the LLVM IR tests, the outlined parallel function is
checked separately for ClangIR (LLVM-CIR) and classic codegen
(LLVM-OGCG). The control flow is the same in both, but the blocks are
named and ordered differently. See the test case comments for more
details.
Assisted by Claude.
Towards: #246586
[Sparc][MC] Check line and column of errors in assembler tests (#247426)
Pin the line and column of the expected errors in the SPARC assembler
tests, instead of only checking the message (or, in sparc-asm-errors.s,
the line with any column).
Also add --implicit-check-not=error: where it was missing so unexpected
errors are caught, and fix the gaps this shows:
- sparcv9-synthetic-instructions.s did not check the V8 error for the
second setuw.
- sparc-mem-asi-instructions.s did not check the V8 error for
"lduba [%i0+%i1] %asi, %o2".
- sparc-directive-xword.s had the same .xword test twice and only
checked the error for the first. Keep one, and use one check prefix
for sparc64 and sparcv9.
- sparc-vis3.s had --implicit-check-not=error: on the run that has no
errors instead of the one that does.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[LoongArch] Select [X]VSAT for vector clamps to narrower ranges
[x]vsat.{b/h/w/d} clamps each element to [-2^imm, 2^imm - 1], and
[x]vsat.{bu/hu/wu/du} to [0, 2^(imm + 1) - 1]. Select them for smin/smax
pairs and umin with such constant bounds, so that e.g.
```
lu12i.w $a0, -8
vreplgr2vr.w $vr1, $a0
vmax.w $vr0, $vr0, $vr1
vldi $vr1, -2433
vmin.w $vr0, $vr0, $vr1
```
becomes:
```
vsat.w $vr0, $vr0, 15
```
[4 lines not shown]
[LoongArch][NFC] Add tests for vector saturation to narrower ranges
Add tests for clamping vector elements to the range of a narrower signed
or unsigned integer, as produced by portable implementations of the
[x]vsat intrinsics.
Assisted-By: LLM
py-httpx2: updated to 2.17.0
2.17.0 (November 30th, 2026)
Changed
* Cache the parsed form of the 128 most recent URL strings of up to 2,048 characters. Repeated requests to the same URL skip parsing and validation. The cached strings, including any credentials in them, stay in memory until they are evicted.
* Give the cookie jar the request URL without userinfo, query or fragment, and with at most 1024 bytes of path. Cookie handling no longer gets slower or uses more memory as the URL gets longer. A response to a URL whose directory is longer than 1024 bytes sets and deletes no cookies, and `http://user:pass@example.org/` now shares cookies with `http://example.org/`.
* Treat `[fe80::1%25en0]` and `[fe80::1%en0]` as the same host. `URL.host` returns the zone decoded, as `fe80::1%en0`, and `str(url)` and `URL.netloc` always write `%25`. A URL in the `%25` form failed to connect before. Cookies saved under a bare `%en0` URL no longer match after upgrading.
* Raise `TypeError` when `Timeout` is built from an unsupported value, such as an `httpx.Timeout`. Before, the request failed later, while connecting.
* Name the header in the `UnicodeEncodeError` raised when a header value cannot be encoded. The message now ends with `(header 'auth')`.
* Skip copying the client headers on requests that pass no `headers=`.
Fixed
* Apply `uds`, `local_address`, `retries` and `socket_options` to the connection to an HTTP proxy, and `retries` to the connection to a SOCKS proxy. `HTTPTransport` and `AsyncHTTPTransport` silently ignored them when `proxy` was set. SOCKS proxies still do not support `uds`, `local_address` and `socket_options`.
* Stop raising `RuntimeError: aclose(): asynchronous generator is already running` when the event loop shuts down, or the garbage collector runs, with streamed responses still open. `Response.aiter_bytes()` no longer calls `aiter_raw()`, so overriding `aiter_raw()` no longer affects `aiter_bytes()`, `aiter_text()`, `aiter_lines()` and `aread()`.
* Omit the IPv6 zone from the `Host` header. A request to `http://[fe80::1%en0]/` sent `Host: [fe80::1%en0]`, which servers such as Apache and lighttpd reject.
* Keep the cookie policy when copying `Cookies`. A policy on the client jar, such as one with `blocked_domains`, was ignored on requests that passed `cookies=`.
[2 lines not shown]
py-httpcore2: updated to 2.17.0
2.17.0 (November 30th, 2026)
Changed
* Check whether the server closed an idle HTTP/1.1 connection when the connection is reused, instead of polling every idle connection on every request. The time per request no longer grows with the number of idle connections: with 100 of them it drops from about 2.6 ms to 0.3 ms. A connection that the server closed now stays in the pool until it is reused, its keep-alive expires, or it is evicted, and `has_expired()` no longer returns `True` for it.
* Skip the cancellation shield when the pool has no connection to close, and look up the raw socket of an AnyIO stream once instead of on every reuse.
Fixed
* Pass `retries`, `local_address`, `uds` and `socket_options` from `ConnectionPool(proxy=...)` and `HTTPProxy` to the connections they create, and retry the TCP connection to the proxy in `SOCKSProxy` when `retries` is set. These options were accepted and ignored before.
* Stop raising `RuntimeError: aclose(): asynchronous generator is already running` when the event loop shuts down, or the garbage collector runs, with streamed responses still open.
[LoongArch] Fold offsets past debug uses in LoongArchMergeBaseOffset
With `-g`, a DBG_VALUE of the base address counts as a use, so the
`hasOneUse()` check in `detectAndFoldOffset` rejects folding a following
ADDI/ADD into the address materialization, and the generated code differs
from `-g0`:
pcalau12i $a0, %pc_hi20(a)
addi.d $a0, $a0, %pc_lo12(a)
addi.d $a0, $a0, 5
Only count non-debug uses there and in the check for two ADDIs in a row.
After the fold the base register holds the address plus the offset, so
salvage its debug users by appending the negated offset to their
expressions, as RISCVMergeBaseOffset already does. In the two-ADDI case,
also redirect the debug users of the intermediate ADDI to the folded
register with the second immediate subtracted, instead of leaving them on
an erased definition.
Assisted-By: LLM
[LoongArch] OptWInstrs: Sign-extend outer PHI operands to remove sext.w in loops
A sext.w inside a loop often cannot be removed only because one of the
values reaching it comes in through a PHI from outside the loop and is not
known to be sign-extended, e.g. an i32 argument that is only any-extended:
preheader:
...
loop:
%p = PHI %x, %preheader, %next, %loop
%s = ADDI_W %p, 0
%next = ADD_D %p, ...
If every other value reaching the sext.w is sign-extended, sign-extend
those PHI operands in their incoming blocks instead and remove the sext.w.
This trades a sext.w executed on every iteration for one executed once per
entry into the loop.
Only incoming blocks with a smaller loop depth than the sext.w are
[8 lines not shown]
[RISCV] Preserve replicated masks in demanded bits simplification (#247452)
A replicated AND mask can be shrunk when the resulting constant has
an equal materialization cost. Queries at different recursion depths
can then shrink it further and restore the replicated mask, causing
DAG combining to loop indefinitely.
Keep the existing mask when it already matches the replicated
candidate. Add a regression covering both -O0 and -O2.
Fixes #247417.
Assisted-by: TRAE CLI (GPT-6)
[LoongArch] Avoid store forwarding blocks in small copies
Store-to-load forwarding fails when a load is wider than the store that
wrote its bytes, for GPR, FPR, LSX and LASX accesses alike. On LA664 such
a load takes 14-17 cycles instead of 7-10.
Small memcpy/memmove are lowered to ld.d/st.d, fld.d/fst.d, vld/vst or
xvld/xvst copies. Add a pass that breaks such a copy into smaller copies
when its load is likely to read data from in-flight narrower stores:
- A narrower store shortly before the load writes inside the copied bytes
through the same base register or frame index: break the copy around
the store.
- In a loop, a store of the previous iteration of at least 8 bytes may
write the same buffer, as in LZ77 back-reference copies: break the copy
into 8-byte pieces.
The pass runs at -O1 and above and can be disabled with
-loongarch-disable-avoid-sfb.
[6 lines not shown]
[LoongArch][NFC] Pre-commit tests for store forwarding blocks in copies
Small copies whose load reads data from in-flight narrower stores,
including LZ77-style overlapping copy loops reduced from the rustc-perf
bufreader benchmark.
[mlir][IntRange] Unwrap nested shaped value types
Update `ConstantIntRanges::getStorageBitwidth` to recursively unwrap
nested `ShapedType` containers that carry the `ValueSemantics` trait
(such as `tensor<...xvector<...xi32>>`), returning 0 for shaped types
without value semantics (such as `memref`).
This ensures a tensor type and its element type always agree on storage
bitwidth, enabling integer range inference to propagate through
`tensor.extract`, `tensor.from_elements`, `tensor.insert`, and
`tensor.splat` on tensors of integer vectors and removing the
`!isIntOrIndex()` workarounds introduced in 2c7efd6f6e1b.
Tighten `IntRangeOptimizations` to reject types with zero storage
bitwidth during constant materialization and to skip elementwise
narrowing when the immediate element type is not an integer or index.
Assisted-by: gemini-4-carbon
[mlir][arith] Narrow arith.select via int ranges
Add a `NarrowSelect` pattern to `populateIntRangeNarrowingPatterns` so
`arith-int-range-narrowing` narrows `arith.select` operations over
signless integer or index scalars, vectors, and tensors when both arms
and the result fit in a narrower target bitwidth under a common signed
or unsigned extension.
`NarrowElementwise` requires all operands to share the result type and
therefore skips `arith.select` due to its `i1` condition operand,
leaving redundant widen/truncate pairs around selects inside narrowed
arithmetic chains.
Assisted-by: gemini-4-carbon
[Clang][Sema] Accept weak reference after declaration (#228809)
GCC accepts a weak reference even after there is a declaration. In here,
we use Check*Decl to do the required check and merge the NewDecl to
declaration chain.
Assisted-by: Claude # Tests ReleaseNote
Fixes: #56760