Skip to content

LLVM 23 breaks tests/assembly-llvm/simd-intrinsic-mask-reduce.rs #156050

Description

@durin42

llvm/llvm-project@66c1b6f made some improvements to optimizations for AArch64 and after that our CI for rust/llvm HEADs together started failing, eg:

---- [assembly] tests/assembly-llvm/simd-intrinsic-mask-reduce.rs#aarch64 stdout ----
------FileCheck stdout------------------------------

------FileCheck stderr------------------------------
rust/tests/assembly-llvm/simd-intrinsic-mask-reduce.rs:38:18: error: aarch64-DAG: expected string not found in input
 // aarch64-DAG: mov [[REG1:[a-z0-9]+]], #1
                 ^
rust/build/x86_64-unknown-linux-gnu/test/assembly-llvm/simd-intrinsic-mask-reduce.aarch64/simd-intrinsic-mask-reduce.s:8:25: note: scanning from here
 cmge v0.16b, v0.16b, #0
                        ^
rust/build/x86_64-unknown-linux-gnu/test/assembly-llvm/simd-intrinsic-mask-reduce.aarch64/simd-intrinsic-mask-reduce.s:10:3: note: possible intended match here
 fmov x8, d0
  ^
rust/tests/assembly-llvm/simd-intrinsic-mask-reduce.rs:55:19: error: aarch64-NEXT: expected string not found in input
 // aarch64-NEXT: umaxv b0, v0.16b
                  ^
rust/build/x86_64-unknown-linux-gnu/test/assembly-llvm/simd-intrinsic-mask-reduce.aarch64/simd-intrinsic-mask-reduce.s:24:25: note: scanning from here
 cmlt v0.16b, v0.16b, #0
                        ^
rust/build/x86_64-unknown-linux-gnu/test/assembly-llvm/simd-intrinsic-mask-reduce.aarch64/simd-intrinsic-mask-reduce.s:25:2: note: possible intended match here
 addp d0, v0.2d
 ^

Input file: rust/build/x86_64-unknown-linux-gnu/test/assembly-llvm/simd-intrinsic-mask-reduce.aarch64/simd-intrinsic-mask-reduce.s
Check file: rust/tests/assembly-llvm/simd-intrinsic-mask-reduce.rs

-dump-input=help explains the following input dump.

the assembly changed thus:

22.s    2026-05-01 10:38:45.093955012 -0400
23.s    2026-05-01 10:34:58.158013732 -0400
@@ -6,10 +6,10 @@
 mask_reduce_all:
        .cfi_startproc
        cmge    v0.16b, v0.16b, #0
-       mov     w8, #1
-       umaxv   b0, v0.16b
-       fmov    w9, s0
-       bic     w0, w8, w9
+       addp    d0, v0.2d
+       fmov    x8, d0
+       cmp     x8, #0
+       cset    w0, eq
        ret
 .Lfunc_end0:
        .size   mask_reduce_all, .Lfunc_end0-mask_reduce_all
@@ -22,9 +22,10 @@
 mask_reduce_any:
        .cfi_startproc
        cmlt    v0.16b, v0.16b, #0
-       umaxv   b0, v0.16b
-       fmov    w8, s0
-       and     w0, w8, #0x1
+       addp    d0, v0.2d
+       fmov    x8, d0
+       cmp     x8, #0
+       cset    w0, ne
        ret
 .Lfunc_end1:
        .size   mask_reduce_any, .Lfunc_end1-mask_reduce_any

I don't know Arm assembly at all really, but it looks like the LLVM 23 variation doesn't have any vector instructions at all, which makes me think that either there's a bug in LLVM or the optimizer is too clever now and is managing to optimize away the vector instruction with something simpler. Either way, I'm filing this tracking bug because I can't work out a fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions