[all-commits] [llvm/llvm-project] b67c5a: [AArch64][SVE] Fix v16i8 -> v2i64 partial_reduce f...
Matthew Blewitt via All-commits
all-commits at lists.llvm.org
Tue Jul 28 23:39:18 PDT 2026
Branch: refs/heads/release/23.x
Home: https://github.com/llvm/llvm-project
Commit: b67c5a8413227dde13122e941f95beb3fc210e8a
https://github.com/llvm/llvm-project/commit/b67c5a8413227dde13122e941f95beb3fc210e8a
Author: Matthew Blewitt <blewitt.matt at gmail.com>
Date: 2026-07-29 (Wed, 29 Jul 2026)
Changed paths:
M llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
M llvm/test/CodeGen/AArch64/sve-fixed-length-partial-reduce.ll
Log Message:
-----------
[AArch64][SVE] Fix v16i8 -> v2i64 partial_reduce for VL > 128 (#204938)
A fixed-length `llvm.vector.partial.reduce.add` reducing `<16 x i8>`
into `<2 x i64>` is lowered on `+sve` by converting the reduction to a
scalable one and finishing with `convertFromScalableVector`. The i8 ->
i64 fold splits the `(nx)v4i32` dot before converting it back to fixed
length, but splitting a scalable container is not equivalent to
splitting the fixed vector it holds: at vscale=2 an `nxv4i32` container
splits into two `nxv2i32`, each holding four i32s, not the two-lane
halves of the underlying `v4i32`. The high partial sums land in lanes
that `convertFromScalableVector` then discards, so any runtime VL > 128
silently drops them — on a 256-bit machine (e.g. Neoverse V1) exactly
half the result is lost (#204939; downstream miscompile
rust-lang/rust#158144).
Convert the dot back to a fixed-length i32 vector before splitting, so
the split, widen and accumulate all happen in fixed length and no lanes
are dropped. The fixed dot width is derived from the result (two i32
lanes per i64 result lane) so the wider, VL-pinned `<4 x i64> <- <32 x
i8>` reduction — which also reaches this fold on plain SVE — lowers
correctly. This is the i64 sibling of the `v16i8 -> v2i32` case fixed in
#177119 (issue #176954); the fixed-length support was introduced in
#142032.
(cherry picked from commit bad9ad339743d262793c15fddfab90bd976e531b)
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list