[llvm] [WebAssembly] Fix missed optimization in 50142 (PR #144741)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 19 16:32:52 PDT 2025
badumbatish wrote:
i updated the code, in the case of 4xi16, the fold doesn't work since i was targeting setcc
```
define i32 @all_true_4_i16(<4 x i16> %v) {
; CHECK-LABEL: all_true_4_i16:
; CHECK: .functype all_true_4_i16 (v128) -> (i32)
; CHECK-NEXT: # %bb.0:
; CHECK-NEXT: v128.const $push0=, 0, 0, 0, 0, 0, 0, 0, 0
; CHECK-NEXT: i16x8.eq $push1=, $0, $pop0
; CHECK-NEXT: i32x4.extend_low_i16x8_s $push2=, $pop1
; CHECK-NEXT: v128.any_true $push3=, $pop2
; CHECK-NEXT: i32.const $push4=, -1
; CHECK-NEXT: i32.xor $push5=, $pop3, $pop4
; CHECK-NEXT: i32.const $push6=, 1
; CHECK-NEXT: i32.and $push7=, $pop5, $pop6
; CHECK-NEXT: return $pop7
%1 = icmp eq <4 x i16> %v, zeroinitializer
%2 = bitcast <4 x i1> %1 to i4
%3 = icmp eq i4 %2, 0
%conv3 = zext i1 %3 to i32
ret i32 %conv3
}
```
https://github.com/llvm/llvm-project/pull/144741
More information about the llvm-commits
mailing list