LLVM/project 5c34792 — mlir/lib/Dialect/Vector/IR ValueBoundsOpInterfaceImpl.cpp, mlir/test/Dialect/Vector value-bounds-op-interface-impl.mlir test-scalable-bounds.mlir

[mlir][vector] Record the positive lower bound of vscale (#241919)

According to the
[docs](https://mlir.llvm.org/docs/Dialects/Vector/#vectorvscale-vectorvectorscaleop)
in the Vector dialect, `vscale` is a positive integer value, so it is at
least 1.

I was working on a patch that touches value bounds and noticed this gap.
For example, the following cannot currently reify a constant lower
bound:

```sh
build/bin/mlir-opt --pass-pipeline='builtin.module(func.func(test-affine-reify-value-bounds,canonicalize))' <<'MLIR'
func.func @vscale_lower_bound() -> index {
  %vscale = vector.vscale
  %lb = "test.reify_bound"(%vscale) {type = "LB", constant} : (index) -> index
  return %lb : index
}
MLIR

    [17 lines not shown]
DeltaFile
+13-0mlir/test/Dialect/Vector/test-scalable-bounds.mlir
+11-0mlir/test/Dialect/Vector/value-bounds-op-interface-impl.mlir
+2-0mlir/lib/Dialect/Vector/IR/ValueBoundsOpInterfaceImpl.cpp
+26-03 files

LLVM/project f5b9faa — llvm/lib/Analysis Loads.cpp, llvm/lib/Transforms/InstCombine InstCombineCompares.cpp

[InstCombine][JumpTableToSwitch] Make a helper for iterating globals elements

Currently there are at least two folds/passes that read elements of a constant
global:

- instcombine's `foldCmpLoadFromIndexedGlobal`
- jump-table-to-switch, when reading the functions from a jump table

and a third one is being written for simplifycfg in PR #229035.

The code to do that is not trivial, especially in its most general form. The
two implementation above currently have different limitations, and PR #229035
has yet another buggy and limited implementation of it.

This PR adds a helper class `ConstGlobalIterator` that analyzes a load from a
global and allows iterating the accessed elements. Current implementation is a
copy of the instcombine's: that's the most general version we have today
(though even that has limitations, e.g. it gives up when the stride is smaller
than the load size).

    [11 lines not shown]
DeltaFile
+51-51llvm/test/Transforms/JumpTableToSwitch/basic.ll
+13-72llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+78-0llvm/lib/Analysis/Loads.cpp
+38-39llvm/test/Transforms/JumpTableToSwitch/skip.ll
+21-42llvm/lib/Transforms/Scalar/JumpTableToSwitch.cpp
+14-14llvm/test/Transforms/JumpTableToSwitch/profile-no-guid-metadata.ll
+215-2188 files not shown
+288-25114 files

LLVM/project e934096 — llvm/lib/Transforms/InstCombine InstCombineCompares.cpp, llvm/test/Transforms/InstCombine load-cmp.ll

[InstCombine] Relax pointer operand type check in foldCmpLoadFromIndexedGlobal

This simplifies code and allows handling `GetElementPtrConstantExpr`.
DeltaFile
+10-10llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+1-2llvm/test/Transforms/InstCombine/load-cmp.ll
+11-122 files

LLVM/project a9a4632 — llvm/test/Transforms/InstCombine load-cmp.ll

Add test
DeltaFile
+13-0llvm/test/Transforms/InstCombine/load-cmp.ll
+13-01 files

LLVM/project 9ef5df8 — llvm/lib/Transforms/InstCombine InstCombineInternal.h InstCombineCasts.cpp

[InstCombine] Simplify foldCmpLoadFromIndexedGlobal calls (NFC) (#242818)

Instead of checking the load's address operand at each call site, check
it once in foldCmpLoadFromIndexedGlobal.
DeltaFile
+17-17llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+4-6llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
+2-4llvm/lib/Transforms/InstCombine/InstCombineInternal.h
+23-273 files

LLVM/project 7600443 — libc/test/src/math/smoke CMakeLists.txt

[libc][math] disable ddivf128 smoke-test for GPU targets (#242831)

addresses the issue reported in
https://github.com/llvm/llvm-project/pull/242651#issuecomment-6895016120
by temporarily disabling the smoke test for GPU targets until a fix is
landed, with a TODO note to re-enable it afterward
DeltaFile
+15-12libc/test/src/math/smoke/CMakeLists.txt
+15-121 files

LLVM/project 6b272cb — llvm/lib/Target/X86 X86ScheduleZnver4.td X86SchedIceLake.td, llvm/test/tools/llvm-mca/X86/Znver4 resources-avx512bw.s resources-avx512bwvl.s

[X86] Add WritePack scheduler classes (#240819)

Split off PACKSSUS DW/WB instructions from WriteShuffle class to remove
need for most custom overrides

znver4 - fixes failure to override rm variants to correctly use FPU1/2
pipes like the rr variants

SapphireRapids and C864GM7/8 - still have overrides for their predicated
instructions - best to leave them until #240761 is finalized.

Fixes #240425
DeltaFile
+24-24llvm/test/tools/llvm-mca/X86/Znver4/resources-avx512bwvl.s
+6-21llvm/lib/Target/X86/X86SchedSapphireRapids.td
+4-21llvm/lib/Target/X86/X86SchedIceLake.td
+12-13llvm/lib/Target/X86/X86InstrSSE.td
+12-12llvm/test/tools/llvm-mca/X86/Znver4/resources-avx512bw.s
+4-18llvm/lib/Target/X86/X86ScheduleZnver4.td
+62-10925 files not shown
+174-24231 files

LLVM/project 6358b96 — clang/test/SemaCXX overload-resolution-deferred-templates.cpp

[Clang][NFC] Add 3 regression tests after #136203 and #122423 (#242644)

Closes https://github.com/llvm/llvm-project/issues/128902
Closes https://github.com/llvm/llvm-project/issues/126855
Closes https://github.com/llvm/llvm-project/issues/49197
DeltaFile
+84-0clang/test/SemaCXX/overload-resolution-deferred-templates.cpp
+84-01 files

LLVM/project fd77b5d — libc/shared/math ddivf128.h, libc/src/__support/math ddivf128.h

[libc][math] Add emulated f128 support for ddivf128 (#242651)

Implements support for ddivf128 to use the emulated f128 type

part of https://github.com/llvm/llvm-project/issues/234601
DeltaFile
+19-0libc/test/src/math/ddivf128_test.cpp
+10-8libc/src/__support/math/ddivf128.h
+12-3libc/test/src/math/smoke/ddivf128_test.cpp
+15-0libc/test/src/math/CMakeLists.txt
+6-7libc/shared/math/ddivf128.h
+10-2libc/src/math/generic/ddivf128.cpp
+72-2025 files not shown
+149-6331 files

LLVM/project 33539ca — llvm/lib/Analysis Loads.cpp, llvm/lib/Transforms/InstCombine InstCombineCompares.cpp

[InstCombine][JumpTableToSwitch] Make a helper for iterating globals elements

Currently there are at least two folds/passes that read elements of a constant
global:

- instcombine's `foldCmpLoadFromIndexedGlobal`
- jump-table-to-switch, when reading the functions from a jump table

and a third one is being written for simplifycfg in PR #229035.

The code to do that is not trivial, especially in its most general form. The
two implementation above currently have different limitations, and PR #229035
has yet another buggy and limited implementation of it.

This PR adds a helper class `ConstGlobalIterator` that analyzes a load from a
global and allows iterating the accessed elements. Current implementation is a
copy of the instcombine's: that's the most general version we have today
(though even that has limitations, e.g. it gives up when the stride is smaller
than the load size).

    [11 lines not shown]
DeltaFile
+51-51llvm/test/Transforms/JumpTableToSwitch/basic.ll
+13-72llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+78-0llvm/lib/Analysis/Loads.cpp
+38-39llvm/test/Transforms/JumpTableToSwitch/skip.ll
+21-42llvm/lib/Transforms/Scalar/JumpTableToSwitch.cpp
+14-14llvm/test/Transforms/JumpTableToSwitch/profile-no-guid-metadata.ll
+215-2188 files not shown
+288-25114 files

LLVM/project dcac8d9 — llvm/test/Transforms/InstCombine load-cmp.ll

Add test
DeltaFile
+13-0llvm/test/Transforms/InstCombine/load-cmp.ll
+13-01 files

LLVM/project ae9dda6 — llvm/lib/Transforms/InstCombine InstCombineCompares.cpp, llvm/test/Transforms/InstCombine load-cmp.ll

[InstCombine] Relax pointer operand type check in foldCmpLoadFromIndexedGlobal

This simplifies code and allows handling `GetElementPtrConstantExpr`.
DeltaFile
+10-10llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+1-2llvm/test/Transforms/InstCombine/load-cmp.ll
+11-122 files

LLVM/project 9f95db9 — llvm/lib/Transforms/InstCombine InstCombineInternal.h InstCombineCasts.cpp

[InstCombine] Simplify foldCmpLoadFromIndexedGlobal calls (NFC)

Instead of checking the load's address operand at each call site, check
it once in foldCmpLoadFromIndexedGlobal.
DeltaFile
+17-17llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+4-6llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
+2-4llvm/lib/Transforms/InstCombine/InstCombineInternal.h
+23-273 files

LLVM/project fc31f00 — mlir/lib/Transforms/Utils RegionUtils.cpp GreedyPatternRewriteDriver.cpp, mlir/test/Transforms canonicalize-cfg-reachability.mlir greedy-label-reachability-op-driver.mlir

[mlir] Add LabelLike trait for blocks entered without a CFG edge

Some ops mark a block that control enters through a jump the CFG does
not show yet. ClangIR's cir.label is the target of cir.goto, which may
leave a region and only becomes a branch once the CFG is flattened.
Such a block often has no predecessors, so eraseUnreachableBlocks
deletes it and the greedy driver skips its ops.

This adds OpTrait::LabelLike for an op that starts a non-entry block,
and findLabelEntry, which returns the op where control enters a block
through a label. That is either the label itself or an op whose regions
contain one, unless that op, or one between it and the label, is
isolated from above.

eraseUnreachableBlocks keeps these blocks, the blocks they reach and the
blocks whose values they use. Region DCE treats every remaining block as
live, and cf.br does not merge a labeled block into its predecessor.

GreedyRewriteConfig::enableRewritingAfterLabels, off by default, lets

    [7 lines not shown]
DeltaFile
+376-0mlir/test/Transforms/greedy-label-reachability.mlir
+202-20mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
+84-4mlir/lib/Transforms/Utils/RegionUtils.cpp
+61-0mlir/test/Transforms/greedy-label-reachability-op-driver.mlir
+58-0mlir/test/Transforms/canonicalize-cfg-reachability.mlir
+53-1mlir/test/lib/Dialect/Test/TestPatterns.cpp
+834-2512 files not shown
+1,053-2918 files

LLVM/project 493a575 — mlir/lib/Dialect/Bufferization/Transforms BufferResultsToOutParams.cpp, mlir/test/Transforms buffer-results-to-out-params-hosit-static-allocs.mlir

[mlir][bufferization] Do not hoist copying allocations to out-params (#242630)

With `hoist-static-allocs` enabled, `-buffer-results-to-out-params`
replaces returned allocations with caller-provided output buffers and
erases their defining operations. Checking only `AllocationOpInterface`
also matches `memref.realloc` and `bufferization.clone`, whose results
preserve or reproduce existing data. Erasing these operations loses that
data and leaves the output buffer partially or entirely uninitialized.

Require `getHoistingKind() != HoistingKind::None` before replacing an
allocation. `memref.realloc` (`None` since #231608) and
`bufferization.clone` (`None` by default) are retained. For the static
results in #242611, the pass copies their contents into the output
parameters through the existing fallback path. `memref.alloc` remains
eligible for replacement.

The check remains interface-based, preserving support for custom
allocation operations introduced in #120288. Such operations remain
eligible when they report a non-None hoisting kind.

    [12 lines not shown]
DeltaFile
+24-0mlir/test/Transforms/buffer-results-to-out-params-hosit-static-allocs.mlir
+7-3mlir/lib/Dialect/Bufferization/Transforms/BufferResultsToOutParams.cpp
+31-32 files

LLVM/project b073dde — lld/MachO Writer.cpp InputFiles.cpp

[lld/mac] Claim per-file work one item at a time (#242765)

This ports #240094 to lld/MachO.

Relocation processing in lld/MachO doesn't need an index, so this can
use parallelForFineGrained instead of parallelForSharded() in lld/ELF.

Linking Chromium Framework on an M4 Max (time trace scopes, median of
7):

    Parse relocations:               115 ms -> 75 ms
    Apply linker optimization hints:  36 ms -> 22 ms

Total link (hyperfine, median of 15): 3.911 s -> 3.859 s

No behavior change.
DeltaFile
+2-1lld/MachO/Writer.cpp
+2-1lld/MachO/InputFiles.cpp
+4-22 files

LLVM/project fd1c6ca — mlir/docs/Rationale SideEffectsAndSpeculation.md

[mlir][docs] Add guidance on "non observable" side effect modeling (#242620)

Mention that a dialect defines which aspects of execution are observable
and which are
implementation details outside that semantic model. Also add a few
examples.

Discussion:
https://discourse.llvm.org/t/guidance-on-not-observable-side-effect-modeling/92790

Assisted-by: Codex
DeltaFile
+47-2mlir/docs/Rationale/SideEffectsAndSpeculation.md
+47-21 files

LLVM/project d626721 — llvm/lib/Transforms/Scalar SROA.cpp, llvm/test/Transforms/SROA byte-conversion-big-endian.ll byte-conversion.ll

[SROA] Don't widen byte values through integers
DeltaFile
+228-15llvm/lib/Transforms/Scalar/SROA.cpp
+19-62llvm/test/Transforms/SROA/byte-conversion.ll
+7-23llvm/test/Transforms/SROA/byte-conversion-big-endian.ll
+254-1003 files

LLVM/project 3b9664b — llvm/test/Transforms/SROA byte-conversion-big-endian.ll byte-conversion.ll

[SROA] Pre-commit tests for byte conversions
DeltaFile
+476-0llvm/test/Transforms/SROA/byte-conversion.ll
+99-0llvm/test/Transforms/SROA/byte-conversion-big-endian.ll
+575-02 files

LLVM/project 731f891 — llvm/lib/Analysis InstructionSimplify.cpp, llvm/test/Transforms/InstSimplify bitinsert-bitextract.ll

[InstSimplify] Simplify vector `bitinsert` and `bitextract` with out-of-range offsets
DeltaFile
+24-5llvm/lib/Analysis/InstructionSimplify.cpp
+2-4llvm/test/Transforms/InstSimplify/bitinsert-bitextract.ll
+26-92 files

LLVM/project d41c8ae — llvm/test/Transforms/InstSimplify bitinsert-bitextract.ll

[InstSimplify] Pre-commit tests for vector `bitinsert` and `bitextract` with out-of-range offsets
DeltaFile
+20-0llvm/test/Transforms/InstSimplify/bitinsert-bitextract.ll
+20-01 files

LLVM/project fa66fc5 — llvm/lib/Analysis InstructionSimplify.cpp, llvm/test/Transforms/InstSimplify bitinsert-bitextract.ll

[InstSimplify] Simplify vector `bitinsert` and `bitextract` with out-of-range offsets
DeltaFile
+24-5llvm/lib/Analysis/InstructionSimplify.cpp
+2-4llvm/test/Transforms/InstSimplify/bitinsert-bitextract.ll
+26-92 files

LLVM/project f7b5fe9 — llvm/test/Transforms/InstSimplify bitinsert-bitextract.ll

[InstSimplify] Pre-commit tests for vector `bitinsert` and `bitextract` with out-of-range offsets
DeltaFile
+20-0llvm/test/Transforms/InstSimplify/bitinsert-bitextract.ll
+20-01 files

LLVM/project f32560f — llvm/test/CodeGen/ARM twoaddrinstr.ll constantpool-align.ll, llvm/test/CodeGen/Thumb2 mve-store-constant.ll

[ARM] Add store-constant test cases. NFC (#242814)
DeltaFile
+81-0llvm/test/CodeGen/ARM/neon-store-constant.ll
+76-0llvm/test/CodeGen/Thumb2/mve-store-constant.ll
+46-15llvm/test/CodeGen/ARM/constantpool-align.ll
+15-13llvm/test/CodeGen/ARM/twoaddrinstr.ll
+218-284 files

LLVM/project 857a709 — llvm/lib/Transforms/Vectorize VPlanUtils.cpp

[VPlan] Build SCEV of VPDerivedIVRecipe like its expansion (NFC). (#242804)

Compute the SCEV of a VPDerivedIVRecipe as Start + zext-or-trunc(Index)
* Step, matching expandVPDerivedIV. Previously Start and Step were
truncated or sign-extended to the type of Index, so the SCEV had Index's
type rather than the recipe's, and VPScalarIVStepsRecipe truncated it
back. Remove that truncate.

All derived IVs queried today have an Index at least as wide as Start,
where both forms fold to the same SCEV.
DeltaFile
+9-9llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
+9-91 files

LLVM/project 8fea0b4 — llvm/lib/Analysis ConstantFolding.cpp, llvm/test/Transforms/InstSimplify ptrtoaddr.ll

[ConstantFolding] Use the pointer width for ptrtoint of inttoptr (#237878)

Previously, folding `ptrtoint (inttoptr C)` truncated C to the address
width and dropped the non-address bits; use the pointer width instead.

Fixes #235642.

Assisted-by: Claude Opus 5.5
DeltaFile
+10-0llvm/test/Transforms/InstSimplify/ptrtoaddr.ll
+4-5llvm/lib/Analysis/ConstantFolding.cpp
+14-52 files

LLVM/project 163b471 — clang/test/Headers __clang_hip_math.hip, flang/lib/Semantics resolve-directives.cpp

Merge branch 'main' into users/zero9178/nvvm-dialect-op-partitions
DeltaFile
+1,275-19,674utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+6,864-0utils/bazel/llvm-project-overlay/libc/src/__support/math/BUILD.bazel
+3,684-0utils/bazel/llvm-project-overlay/libc/src/math/BUILD.bazel
+1,728-1,728clang/test/Headers/__clang_hip_math.hip
+1,512-1,574llvm/test/CodeGen/X86/clmul-vector.ll
+1,434-1,354flang/lib/Semantics/resolve-directives.cpp
+16,497-24,3301,489 files not shown
+62,191-50,8851,495 files

LLVM/project 6fd40e0 — llvm/lib/Analysis ConstantFolding.cpp, llvm/test/Transforms/InstSimplify/ConstProp bitinsert-bitextract.ll

[ConstantFolding] Fold vector `bitinsert` and `bitextract`
DeltaFile
+67-6llvm/lib/Analysis/ConstantFolding.cpp
+12-27llvm/test/Transforms/InstSimplify/ConstProp/bitinsert-bitextract.ll
+79-332 files

LLVM/project 31d8b8c — llvm/test/Transforms/InstSimplify/ConstProp bitinsert-bitextract.ll

[ConstantFolding] Pre-commit tests for vector `bitinsert` and `bitextract`
DeltaFile
+112-0llvm/test/Transforms/InstSimplify/ConstProp/bitinsert-bitextract.ll
+112-01 files

LLVM/project 46a6a91 — llvm/lib/Analysis ConstantFolding.cpp, llvm/test/Transforms/InstSimplify bitcast-vector-fold.ll

[ConstantFolding] Fold constant vector `bitcast`s to scalar bytes
DeltaFile
+20-8llvm/test/Transforms/InstSimplify/bitcast-vector-fold.ll
+19-5llvm/lib/Analysis/ConstantFolding.cpp
+2-4llvm/test/Transforms/InstSimplify/ConstProp/bitinsert-bitextract.ll
+41-173 files