LLVM/project f20eeaf — llvm/lib/Analysis ScalarEvolution.cpp, llvm/test/Analysis/ScalarEvolution max-backedge-taken-count-guard-info-rewrite-expressions.ll

[SCEV] Apply loop guard rewrites to mul expressions. (#243622)

Also rewrite SCEVMulExpr in SCEVLoopGuardRewriter.

This mostly improves constant BTCs, leading to additional unrolling in a
number of cases end-to-end, as well as additional simplifications, like
removing minimum iteration checks created by LoopVectorize:
https://github.com/dtcxzyw/llvm-opt-benchmark-nightly/pull/2067

In a few cases (linux/scatterlist, ibwebp/pnmdec, abc/cadical_kitten)
there are minor regressions of SCEV expansions.

After recent SCEV improvements, compile-time geomean increases are in
the noise. ClamAV compile-time increases by 0.03% - 0.04%Per workload:

https://llvm-compile-time-tracker.com/compare.php?from=4d669bea8878d02f94e427f1e41014f6480e4f23&to=1b9138a3b36ce7c369f70e12d8cafce76a0ba614&stat=instructions:u

PR: https://github.com/llvm/llvm-project/pull/243622
DeltaFile
+103-0llvm/test/Analysis/ScalarEvolution/max-backedge-taken-count-guard-info-rewrite-expressions.ll
+2-2llvm/lib/Analysis/ScalarEvolution.cpp
+105-22 files

LLVM/project c5def9b — llvm/test/CodeGen/ARM fpclamptosat.ll fpclamptosat_vec.ll, llvm/test/CodeGen/RISCV fpclamptosat.ll

[SelectionDAG] Convert soft-promoted f16 to wide integers without a libcall (#235259)

#230779 converts `f16` to the half-width integer type and extends it
when the result of `fp_to_[su]int` must be expanded, but only when `f16`
is legal. When `f16` is soft-promoted (e.g. RISC-V with F but without
Zfh, ARM with VFP but without fullfp16), the conversion still calls
`__fixsfti`, `__fixsfdi`, `__aeabi_f2lz` or their unsigned variants.

Take the same path when `f16` is soft-promoted and `f32` is legal; the
narrower conversion extends the operand to `f32`. The conversion keeps
`f16` as its source type, so that the second expansion of `i128` on
32-bit targets also takes this path. Targets without `f32` keep the
libcall.

Assisted-by: Claude Opus 5.5
DeltaFile
+654-660llvm/test/CodeGen/ARM/fpclamptosat_vec.ll
+224-305llvm/test/CodeGen/RISCV/rvv/fpclamptosat_vec.ll
+111-245llvm/test/CodeGen/WebAssembly/fpclamptosat_vec.ll
+85-90llvm/test/CodeGen/ARM/fpclamptosat.ll
+84-87llvm/test/CodeGen/RISCV/fpclamptosat.ll
+33-133llvm/test/CodeGen/WebAssembly/fpclamptosat.ll
+1,191-1,5208 files not shown
+1,323-1,69314 files

LLVM/project 7662450 — llvm/lib/Target/AArch64 AArch64TargetTransformInfo.cpp, llvm/test/Transforms/LoopVectorize/AArch64 interleave-for-latency.ll interleaved_latency_cost.ll

[AArch64] Implement latency costs for interleaved loads (#236428)

This is done by moving the existing code for getting the latency of
plain loads out into a separate function and calling that.
DeltaFile
+726-0llvm/test/Transforms/LoopVectorize/AArch64/interleaved_latency_cost.ll
+121-6llvm/test/Transforms/LoopVectorize/AArch64/interleave-for-latency.ll
+71-25llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
+918-313 files

LLVM/project 7376d08 — flang/lib/Optimizer/Transforms MIFOpConversion.cpp, flang/test/Fir/MIF event_query03.mlir event_query01.mlir

[flang][MIF] Add lowering for EVENT_QUERY (#237317)

This PR adds lowering support for the `EVENT_QUERY` intrinsic. It is
lowered to a new `mif.event_query` operation, which is then converted to
the corresponding PRIF call.

---------

Co-authored-by: Dan Bonachea <dobonachea at lbl.gov>
DeltaFile
+643-0flang/test/Fir/MIF/event_query02.mlir
+266-0flang/test/Lower/MIF/event_query02.f90
+241-0flang/test/Fir/MIF/event_query01.mlir
+127-0flang/test/Lower/MIF/event_query01.f90
+50-11flang/lib/Optimizer/Transforms/MIFOpConversion.cpp
+50-0flang/test/Fir/MIF/event_query03.mlir
+1,377-116 files not shown
+1,444-1312 files

LLVM/project f04e8be — flang/lib/Lower MultiImageFortran.cpp, flang/lib/Optimizer/Transforms MIFOpConversion.cpp

[flang][MIF] Fix STAT= specifier handling in coarray allocation #231248 (#237327)

`ALLOCATE `of a coarray with `STAT=` did not handle the result of
`prif_allocate_coarray `correctly:

The result of the allocation was never checked if STAT is specified, so
the descriptor update the base_addr, the default initialization and
`prif_sync_all `ran even when the allocation failed.

Fixes #231248.

---------

Co-authored-by: Dan Bonachea <dobonachea at lbl.gov>
Co-authored-by: Eugene Epshteyn <eepshteyn at nvidia.com>
DeltaFile
+275-0flang/test/Fir/MIF/coarray_alloc_with_stat_check.mlir
+65-0flang/test/Lower/MIF/coarray_alloc_stat.f90
+44-4flang/lib/Optimizer/Transforms/MIFOpConversion.cpp
+2-0flang/lib/Lower/MultiImageFortran.cpp
+386-44 files

LLVM/project 5dbe0c8 — llvm/lib/Target/LoongArch LoongArchISelLowering.cpp, llvm/test/CodeGen/LoongArch bstrins_w.ll bstrins_d.ll

[LoongArch] Match BSTRINS when an OR operand is already a BSTRPICK

performANDCombine rewrites (and X, mask) into BSTRPICK, or into
(shl (BSTRPICK X, msb, lsb), lsb) for a shifted mask. The BSTRINS
patterns in performORCombine only match ISD::AND, so they miss an OR
whose AND operand was rewritten before the OR was combined. In the
default order this happens when the operand only becomes an AND after
the OR was combined, e.g. in an expanded funnel shift. With
-combiner-topological-sorting (#83422), which visits operands before
their users, it happens for any OR. The OR is then selected as separate
bstrpick, shift and or instructions.

Before matching, turn such operands back into the AND they came from,
and build the result from the original operands. The pattern conditions
are unchanged.

In the default order this shortens the funnel shift tests. In a sample
of real-world bitcode compiled for loongarch64, 7 functions get shorter
and none longer, e.g. a byte inserted into the top of an i64 and vXi1

    [3 lines not shown]
DeltaFile
+47-5llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
+3-7llvm/test/CodeGen/LoongArch/bstrins_d.ll
+2-3llvm/test/CodeGen/LoongArch/bstrins_w.ll
+52-153 files

LLVM/project ed83a5d — llvm/test/CodeGen/LoongArch bstrins_w.ll bstrins_d.ll

[LoongArch] Add BSTRINS tests with an OR built from a funnel shift (NFC)

Expanding the funnel shift creates the OR first. Its operand only
becomes an AND, which performANDCombine turns into BSTRPICK, after the
OR has been combined, so no BSTRINS pattern matches when the OR is
combined again.

Assisted-by: Claude Code (Claude Opus 5.5)
DeltaFile
+30-0llvm/test/CodeGen/LoongArch/bstrins_d.ll
+16-0llvm/test/CodeGen/LoongArch/bstrins_w.ll
+46-02 files

LLVM/project f5b92ae — clang/lib/Basic/Targets AArch64.h AArch64.cpp, clang/test/Preprocessor aarch64-target-features.c

[AArch64] Add __ARM_FEATURE_LSCP macro (#241957)

This patch adds macro for detecting presence of
FEAT_LSCP feature as proposed in
[ACLE](https://github.com/ARM-software/acle/pull/477)
DeltaFile
+6-0clang/test/Preprocessor/aarch64-target-features.c
+6-0clang/lib/Basic/Targets/AArch64.cpp
+1-0clang/lib/Basic/Targets/AArch64.h
+13-03 files

LLVM/project 0c9b33c — lldb/test/API/functionalities/breakpoint/breakpoint_hit_count TestBreakpointHitCount.py

[lldb][test] Report the launch error in test_breakpoint_one_shot (#243803)

`TestBreakpointHitCount.test_breakpoint_one_shot` on the
`lldb-cmake-sanitized` failed

```
ERROR: test_breakpoint_one_shot (TestBreakpointHitCount.BreakpointHitCountTestCase)
...
AttributeError: 'NoneType' object has no attribute 'IsValid'
```

`SBTarget::LaunchSimple` launch failed, but caller doesn't get the
error.
The fix is to replace it with `Launch`, and call `assertSuccess(error)`.

Assisted-by: Claude
DeltaFile
+5-2lldb/test/API/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py
+5-21 files

LLVM/project 18cbd31 — libcxx/include/__algorithm pstl.h, libcxx/include/__pstl backend_fwd.h

[libc++][pstl] Add a serial implementation of std::copy_if (#241782)

This PR adds a serial implementation of `std::copy_if` to PSTL.
Within this patch it's added only to the serial backend, such that any
other backend can fall back to this implementation.
A real parallel implementation is intended to land within the statpart
backend later, which will be a purely additive change, it will not touch
the code in this PR.

Part of #99938.
DeltaFile
+212-0libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/pstl.copy_if.pass.cpp
+24-0libcxx/include/__algorithm/pstl.h
+11-0libcxx/include/__pstl/backends/serial.h
+9-0libcxx/test/std/algorithms/pstl.exception_handling.pass.cpp
+7-0libcxx/include/__pstl/backend_fwd.h
+5-0libcxx/test/libcxx/algorithms/pstl.iterator-requirements.verify.cpp
+268-01 files not shown
+270-07 files

LLVM/project e3e6d87 — flang/lib/Lower/OpenMP OpenMP.cpp, flang/lib/Semantics check-omp-structure.cpp check-omp-variant.cpp

[flang][OpenMP] Handle declarative METADIRECTIVES more carefully

Diagnose declarative METADIRECTIVEs with executable variants as errors.
A METADIRECTIVE is considered executable if it contains at least one
executable variant. Mixing declarative and executable variants is not
supported.

There are several things that can appear in either the specification part
or in the execution part in a Fortran program unit. METADIRECTIVEs are
one example, and there is already code that tries to canonicalize then,
i.e. move them into the execution part if they are considered executable
and are at the end of the specification part.
In fact, the entire tail of the specification part is moved into the
execution part if it could be considered executable.

Since OmpMetadirectiveDirective is an allowed member of a specification
part, the parser will preferentially insert METADIRECTIVEs into the
specification part even if they are executable according to the above
definition.

    [7 lines not shown]
DeltaFile
+79-14flang/lib/Semantics/canonicalize-omp.cpp
+67-19flang/lib/Semantics/check-omp-variant.cpp
+6-73flang/test/Lower/OpenMP/Todo/metadirective-loop-intervening-statement.f90
+2-24flang/lib/Lower/OpenMP/OpenMP.cpp
+16-9flang/test/Semantics/OpenMP/metadirective-loop-nest.f90
+11-2flang/lib/Semantics/check-omp-structure.cpp
+181-1413 files not shown
+195-1419 files

LLVM/project 605a257 — libcxxabi/src private_typeinfo.h private_typeinfo.cpp

[libc++abi] Make the dst_type uniqueness flag in dynamic_cast a bool
DeltaFile
+5-6libcxxabi/src/private_typeinfo.cpp
+2-2libcxxabi/src/private_typeinfo.h
+7-82 files

LLVM/project bb8598f — libcxxabi/src private_typeinfo.h private_typeinfo.cpp

[libc++abi] Return a result type inside dynamic_cast
DeltaFile
+109-97libcxxabi/src/private_typeinfo.cpp
+35-29libcxxabi/src/private_typeinfo.h
+144-1262 files

LLVM/project 56a758c — llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/X86 interchangeable-cmp-predicates.ll

[SLP]Inverse trunc to i1 bit tests in select conditions

InstCombine folds select (icmp eq (and X, 1), 0), A, B to
select (trunc X to i1), B, A, which swaps the select operands of the
trunc lanes against the other eq bit tests. Emit these lanes as
and X, 1 == 0 with the swapped gathered operands, and price them as
the bit test compares.

Fixes #238902

Assisted-by: Cursor

Pull-request: https://github.com/llvm/llvm-project/pull/238984
Reviewers: RKSimon, bababuck
Reviewed-by: bababuck
DeltaFile
+217-100llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+21-21llvm/test/Transforms/SLPVectorizer/X86/interchangeable-cmp-predicates.ll
+238-1212 files

LLVM/project 283f757 — llvm/lib/Transforms/Scalar SROA.cpp, llvm/test/Transforms/SROA byte-conversion.ll

[SROA] Don't widen byte values through integers
DeltaFile
+319-42llvm/lib/Transforms/Scalar/SROA.cpp
+128-142llvm/test/Transforms/SROA/byte-conversion.ll
+447-1842 files

LLVM/project 5fc37d9 — llvm/test/Transforms/SROA byte-conversion.ll

[SROA] Pre-commit tests for byte conversions
DeltaFile
+715-0llvm/test/Transforms/SROA/byte-conversion.ll
+715-01 files

LLVM/project 0f253eb — offload/plugins-nextgen/common/include PluginInterface.h OffloadError.h, offload/plugins-nextgen/common/src JIT.cpp

[Offload][NFC] Avoid unnecessary string copies  (#243794)

A few small changes suggested by a static code analysis tool to avoid
unnecessary std::string copies.

A summary of the changes and reason is here (AI-generated):

- Plugin::error / createOffloadError (Error&& overload) in
OffloadError.h and PluginInterface.h: take a StringRef context instead
of const char *. Callers holding a std::string no longer go through
c_str() and a second std::string construction.
- L0Device.cpp: pass the message std::string directly to Plugin::error
instead of Buffer.c_str().
- JIT.cpp: createTargetMachine takes the CPU name as StringRef instead
of std::string by value. It is never modified and is only forwarded to a
StringRef parameter.
- L0Program.h / L0Program.cpp: KernelsToModuleMap is a llvm::StringMap,
so kernel-name lookups no longer build a temporary std::string.
try_emplace keeps the same first-entry-wins behavior as emplace.

Assisted by Claude.
DeltaFile
+4-2offload/plugins-nextgen/level_zero/include/L0Program.h
+3-2offload/plugins-nextgen/common/include/OffloadError.h
+1-2offload/plugins-nextgen/level_zero/src/L0Device.cpp
+1-1offload/plugins-nextgen/level_zero/src/L0Program.cpp
+1-1offload/plugins-nextgen/common/src/JIT.cpp
+1-1offload/plugins-nextgen/common/include/PluginInterface.h
+11-96 files

LLVM/project 965d543 — mlir/lib/Conversion/GPUCommon GPUOpsLowering.cpp, mlir/lib/Conversion/GPUToROCDL LowerGpuOpsToROCDLOps.cpp

[mlir][LLVM] Include LLVM dialect partition headers instead of LLVMDialect.h (#242307)

Most includers of `LLVMDialect.h` use only a few LLVM dialect ops, or
none at all, but still pay for all 323 op declarations. Widely included
headers such as `OpenMPDialect.h`, `NVVMDialect.h` and `GPUCommonPass.h`
include it as well, spreading the cost to TUs that never use the LLVM
dialect.

Building on #242301, this patch makes every file include what it uses:
the partition headers of the ops it uses, `LLVMDialectDecl.h`,
`LLVMTypes.h`, `LLVMAttrs.h` or `LLVMInterfaces.h` if it only uses the
dialect, types, attributes or interfaces, and forward declarations where
a declaration suffices. Headers no longer include LLVM dialect headers
on behalf of their includers. Files that use ops from at least 8 of the
14 partitions keep `LLVMDialect.h`.

This reduces the TUs including `LLVMDialect.h` in an MLIR, flang and CIR
build from 386 to 41. Downstream code that relied on getting LLVM
dialect ops transitively has to include the partition headers it needs.

    [18 lines not shown]
DeltaFile
+12-1mlir/lib/Target/LLVMIR/ModuleImport.cpp
+11-1mlir/lib/Dialect/LLVMIR/Transforms/InlinerInterfaceImpl.cpp
+9-1mlir/lib/Conversion/LLVMCommon/Pattern.cpp
+8-1mlir/lib/Conversion/XeVMToLLVM/XeVMToLLVM.cpp
+8-1mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp
+8-1mlir/lib/Conversion/GPUCommon/GPUOpsLowering.cpp
+56-6197 files not shown
+466-178203 files

LLVM/project 454c377 — llvm/lib/Target/X86 X86ISelLowering.cpp, llvm/test/CodeGen/X86 vector-shuffle-combining-avx2.ll

[X86] PALIGNR/PSHLDQ/PSRLDQ/VPERM2X128 targets shuffles never create undef/poison (#243806)

Add missing target shuffles that all hit
isGuaranteedNotToBeUndefOrPoisonForTargetNode in existing lit-tests to
help smoke out remaining FREEZE regressions for #243178 / #152107 etc.
DeltaFile
+32-26llvm/test/CodeGen/X86/vector-shuffle-combining-avx2.ll
+8-0llvm/lib/Target/X86/X86ISelLowering.cpp
+40-262 files

LLVM/project 4154526 — llvm/include/llvm/IR Analysis.h

[IR] Increase the inline size of PreservedAnalyses::PreservedIDs (NFC) (#243624)

The current default triggers the large codepath (requiring non-trivial
heap allocation) in a large number of cases.

Update to use 8 elements inline, which avoids going to the heap in most
cases and improves compile-time:

stage1-O3: -0.06%
stage1-ReleaseThinLTO: -0.07%
stage1-ReleaseLTO-g: -0.05%
stage1-aarch64-O3: -0.06%
stage2-O3: -0.05%
stage2-clang: -0.09%


https://llvm-compile-time-tracker.com/compare.php?from=ce73ba2fc443a38847cc6da688ed22bc16fe0f8c&to=eb95dfd7244fb5ef7706f66502a143ac14fc23ff&stat=instructions:u

Assisted-by: Opus 5.5

PR: https://github.com/llvm/llvm-project/pull/243624
DeltaFile
+1-1llvm/include/llvm/IR/Analysis.h
+1-11 files

LLVM/project 0e82f6c — lldb/test lldbflakes.py, lldb/test/API lldbtest.py

[lldb] Don't re-run XFAILed tests (#243492)

Re-running tests that are expected to fail does not give useful signal.
This patch makes it so that they don't re-run.
DeltaFile
+10-1lldb/test/lldbflakes.py
+1-1lldb/test/Shell/helper/toolchain.py
+1-1lldb/test/API/lldbtest.py
+12-33 files

LLVM/project 10b4bf0 — mlir/lib/Dialect/Tosa/IR TosaOps.cpp, mlir/test/Dialect/Tosa verifier.mlir

[mlir][tosa]Check for non tensor type and fail gracefully (#243805)

Following error report
[llvm-project#236561](https://github.com/llvm/llvm-project/issues/236561)
added check for non tensor output type in TOSA block scaled type
verification.

Signed-off-by: Philip Wilkinson <philip.wilkinson at arm.com>
DeltaFile
+9-0mlir/test/Dialect/Tosa/verifier.mlir
+6-0mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
+15-02 files

LLVM/project 0cc5830 — clang/include/clang/CIR/Dialect/Builder CIRBaseBuilder.h, clang/include/clang/CIR/Dialect/IR CIROps.td

[CIR] Use `cir.vec.fcmp` op for all fp vector comparisons (#241348)

Also removes support for floating point vectors from `cir.vec.cmp` op.

Claude helped with test updates.
DeltaFile
+0-150clang/test/CIR/Transforms/vector-cmp-fold.cir
+35-92clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+33-3clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp
+5-20clang/include/clang/CIR/Dialect/IR/CIROps.td
+0-15clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+3-12clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h
+76-2926 files not shown
+100-32912 files

LLVM/project 1531ce2 — llvm/lib/Target/X86 X86SchedLunarlakeP.td, llvm/test/tools/llvm-mca/X86/LunarlakeP resources-ssse3.s resources-sse1.s

[X86] Fix Lunar Lake ROB/RS sizes and FP ops on integer ports (#242473)

Address the data issues in X86SchedLunarlakeP.td reported in #209145:

- MicroOpBufferSize: the Lion Cove ROB has 576 entries.
- The integer scheduler has 120 reservation stations.
- (V)ADDSSrr/(V)SUBSSrr(_Int) use WriteFAdd: V2/V3, latency 2.
- (V)PALIGNRrri, VPALIGNRYrri and xmm VPBROADCAST{B,D,Q,W}rr run on the
vector shuffle ports V2/V3.

Measured on a Core Ultra 7 258V P-core with perf and
VEC_DISPATCHED.V0-V3: addss/subss (SSE and VEX) latency 2, 1 uop on
V2/V3, 0.5 cycles throughput; palignr/vpbroadcast xmm latency 1, 1 uop
on V2/V3, 0.5 cycles throughput. The model now matches both.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+11-11llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-avx2.s
+7-7llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-avx1.s
+4-8llvm/lib/Target/X86/X86SchedLunarlakeP.td
+5-5llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-sse1.s
+3-3llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-ssse3.s
+30-345 files

LLVM/project 58194d2 — clang/test/OpenMP target_no_loop.cpp

Adds test cases, addressing review comments
DeltaFile
+48-4clang/test/OpenMP/target_no_loop.cpp
+48-41 files

LLVM/project 35fec28 — mlir/include/mlir/Dialect/SPIRV/IR SPIRVNonUniformOps.td, mlir/test/Dialect/SPIRV/IR non-uniform-ops.mlir

[mlir][SPIR-V] Require matching types in GroupNonUniform arithmetic ops (#243773)

The spec requires Value to have the same type as Result Type, but the
shared op definition accepted mismatched types such as i32 -> i64
DeltaFile
+24-0mlir/test/Dialect/SPIRV/IR/non-uniform-ops.mlir
+1-0mlir/include/mlir/Dialect/SPIRV/IR/SPIRVNonUniformOps.td
+25-02 files

LLVM/project d61e07b — .github/workflows libc-fullbuild-tests.yml

Create it as a new job
DeltaFile
+8-0.github/workflows/libc-fullbuild-tests.yml
+8-01 files

LLVM/project 030021a — .github/workflows libc-fullbuild-tests.yml

[libc] Enable baremetal Armv8.1-M.Main no-FP premerge tests
DeltaFile
+1-1.github/workflows/libc-fullbuild-tests.yml
+1-11 files

LLVM/project 8bb728d — llvm/lib/Target/AMDGPU AMDGPUMemoryUtils.h

[NFC] Remove some obsolete includes

They were needed for intermediate states of this PR, but the current
final state doesn't need them any more.
DeltaFile
+0-2llvm/lib/Target/AMDGPU/AMDGPUMemoryUtils.h
+0-21 files

LLVM/project 5aa6dbc — llvm/lib/Target/AMDGPU SIMemoryLegalizer.cpp AMDGPUMemoryUtils.h

Remove std::optional from getSynchronizeAddrSpace's return type
DeltaFile
+7-7llvm/lib/Target/AMDGPU/AMDGPUMemoryUtils.cpp
+6-7llvm/lib/Target/AMDGPU/AMDGPUMemoryUtils.h
+3-6llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp
+16-203 files