[libc++] Make detect-changepoints much faster (#236245)
The permutation test used to find changepoints was the bottleneck of the
LNT refinement job. This patch makes the test much cheaper in two ways
without changing the algorithm:
- Compute the best split of a segment only once, when the segment is
created.
- Scoring every split of a segment only needs the sums of distances
within the first t points and between the first t points and the whole
segment. The latter doesn't depend on the order of the points, so it is
computed once per segment.
This was measured to be roughly 10x faster as the previous algorithm,
and gives the same results.
Assisted by Claude
[libc][CODEOWNERS] Route math reviews to lntue (#236204)
Math, FPUtil, and complex entrypoints require specialised domain
expertise and clutter the review dashboard for the rest of the libc
team.
Route these directories to lntue rather than reviewers-libc.
Assisted-by: Automated tooling, human reviewed.
[SandboxVec][SeedCollector] Fix insertion into seed container (#235853)
This patch fixes the insertion into the seed container when we have a
mem access with the same key as the existing seed bundle, but insertion
into it fails because the pointer access is not a constant distance.
[OpenCL] Diagnose invalid pipe packet types when formed (#234347)
Validation is limited to function parameters and misses invalid pipe
typedefs such as `typedef pipe void P;`. Move this validation into
`BuildReadPipeType` and `BuildWritePipeType` so declarations and
template instantiations follow the same packet-type restrictions.
Reject pointer, reference, block pointer, non-object, and non-dependent
incomplete packet types. Defer checks that require a concrete type until
template substitution, but diagnose dependent function types
immediately. Report errors at the `pipe` keyword.
Assisted-by: Codex / GPT-5.6 Sol + GPT-6 Astra
[CIR][OpenMP] Add support for host_eval so that SPMD kernels can be used
This patch adds support for host_eval so that SPMD kernels and in the future
num_threads and other clauses can be implemented correctly.
Assisted-by: Cursor / Claude Sonnet 5 High
[CIR][OpenMP] Add support for the OpenMP 'for' directive
This patch adds support for wsloop in ClangIR: the `for` directive and its
combined forms `parallel for` and `target parallel for`. This is lowered to an
omp.wsloop + omp.loop_nest, nested utilizing the existing queue-based
decomposition.
Assisted-by: Cursor / Claude Sonnet 5 High
[CIR][OpenMP] Add support for 'distribute parallel for' with 'target teams'
Adds support for handling the full '[target] teams distribute parallel for'.
Introduces setting the omp.composite attibute for the 'distribute parallel for'
composite construct.
Assisted-by: Cursor / Claude Sonnet 5 High
[CIR][OpenMP] Add support for omp teams
This patch adds support for the OpenMP 'teams' directive, both standalone
and as the combined `target teams` construct. isCombinableLeaf now also
recognizes teams, so an explicitly-nested `target` + `teams` pair gets
the same omp.combined marking as the combined case.
Assisted-by: Cursor / Claude Sonnet 5 High
[CIR][OpenMP] Add initial support for distribute
This patch adds initial support for the OpenMP 'distribute' directive. Basic
code generation for the standalone and combined cases is introduced. Support
for clauses will be added in the future. The composite 'teams distribute
parallel for' form will be added in a subsequent patch.
Assisted-by: Cursor / Claude Sonnet 5 High
[ExecutionEngine] Return GV for binary ConstantExprs in getConstantValue (#236232)
This patch restores "return GV;" for Add, Sub, and Xor constant
expressions in ExecutionEngine::getConstantValue.
Commit 0ba7764723026882df1f302765b9aa848a56960c flattened the outer
type switch in the binary operator case of
ExecutionEngine::getConstantValue, accidentally keeping the inner
"break;" statement in place of "return GV;". Without this fix, GV is
never read, and Add, Sub, and Xor constant expressions fall through to
report_fatal_error.
Assisted-by: Antigravity
[HLSL] Use icmp ne instead of trunc on boolean load (resubmission) (#234771)
Corrects [PR #221105](https://github.com/llvm/llvm-project/pull/221105),
which was reverted due to buildbot failures. Some of the builders
reported an unsupported triple for
clang/test/CodeGenHLSL/bool-vector-load.hlsl, presumably due to a lack
of DirectX support; the test now checks the generic LLVM IR. Only the
RUN and CHECK lines of that test have changed from the earlier PR.
Fixes #140824
Assisted-by: Claude Sonnet 4
[AMDGPU] Remove unreachable buildReduction from AtomicOptimizer (NFC) (#234082)
Since #211757 the pass uses wave.reduce unless the value is divergent
and the result is used. So the DPP scan always has a used result, and
buildReduction, which it only called for an unused one, can't be
reached. Drop it and the NeedResult check before buildShiftRight.