[llvm] wasm: recognize `any_true` and `all_true` (PR #155885)

Petr Penzin via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 2 04:43:17 PST 2026


================
@@ -244,13 +244,25 @@ define i1 @test_any_v7i1(<7 x i1> %x) {
 ; CHECK-LABEL: test_any_v7i1:
 ; CHECK:         .functype test_any_v7i1 (i32, i32, i32, i32, i32, i32, i32) -> (i32)
 ; CHECK-NEXT:  # %bb.0:
-; CHECK-NEXT:    i32.or $push0=, $0, $1
-; CHECK-NEXT:    i32.or $push1=, $pop0, $2
-; CHECK-NEXT:    i32.or $push2=, $pop1, $3
-; CHECK-NEXT:    i32.or $push3=, $pop2, $4
-; CHECK-NEXT:    i32.or $push4=, $pop3, $5
-; CHECK-NEXT:    i32.or $push5=, $pop4, $6
-; CHECK-NEXT:    return $pop5
+; CHECK-NEXT:    v128.const $push0=, 0, 0, 0, 0, 0, 0, 0, 0
----------------
ppenzin wrote:

New sequence is very expensive compared to the old one, as instead of 6 scalar ops it would perform 3 bytewise shuffles and over a dozen lane manipulation operations. This is virtually guaranteed to be significantly slower.

https://github.com/llvm/llvm-project/pull/155885


More information about the llvm-commits mailing list