Skip to content

Commit cdd9b6e

Browse files
committed
Precommit missed optimization test for #50142
1 parent af51c9d commit cdd9b6e

File tree

1 file changed

+104
-0
lines changed

1 file changed

+104
-0
lines changed
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2+
; RUN: llc < %s -verify-machineinstrs -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -mattr=+simd128 | FileCheck %s
3+
4+
target triple = "wasm64"
5+
6+
define i32 @all_true_16_i8(<16 x i8> %v) {
7+
; CHECK-LABEL: all_true_16_i8:
8+
; CHECK: .functype all_true_16_i8 (v128) -> (i32)
9+
; CHECK-NEXT: # %bb.0:
10+
; CHECK-NEXT: v128.const $push0=, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11+
; CHECK-NEXT: i8x16.eq $push1=, $0, $pop0
12+
; CHECK-NEXT: v128.any_true $push2=, $pop1
13+
; CHECK-NEXT: i32.const $push3=, -1
14+
; CHECK-NEXT: i32.xor $push4=, $pop2, $pop3
15+
; CHECK-NEXT: i32.const $push5=, 1
16+
; CHECK-NEXT: i32.and $push6=, $pop4, $pop5
17+
; CHECK-NEXT: return $pop6
18+
%1 = icmp eq <16 x i8> %v, zeroinitializer
19+
%2 = bitcast <16 x i1> %1 to i16
20+
%3 = icmp eq i16 %2, 0
21+
%conv3 = zext i1 %3 to i32
22+
ret i32 %conv3
23+
}
24+
25+
26+
define i32 @all_true_4_i32(<4 x i32> %v) {
27+
; CHECK-LABEL: all_true_4_i32:
28+
; CHECK: .functype all_true_4_i32 (v128) -> (i32)
29+
; CHECK-NEXT: # %bb.0:
30+
; CHECK-NEXT: v128.const $push0=, 0, 0, 0, 0
31+
; CHECK-NEXT: i32x4.eq $push1=, $0, $pop0
32+
; CHECK-NEXT: v128.any_true $push2=, $pop1
33+
; CHECK-NEXT: i32.const $push3=, -1
34+
; CHECK-NEXT: i32.xor $push4=, $pop2, $pop3
35+
; CHECK-NEXT: i32.const $push5=, 1
36+
; CHECK-NEXT: i32.and $push6=, $pop4, $pop5
37+
; CHECK-NEXT: return $pop6
38+
%1 = icmp eq <4 x i32> %v, zeroinitializer
39+
%2 = bitcast <4 x i1> %1 to i4
40+
%3 = icmp eq i4 %2, 0
41+
%conv3 = zext i1 %3 to i32
42+
ret i32 %conv3
43+
}
44+
45+
46+
define i32 @all_true_8_i16(<8 x i16> %v) {
47+
; CHECK-LABEL: all_true_8_i16:
48+
; CHECK: .functype all_true_8_i16 (v128) -> (i32)
49+
; CHECK-NEXT: # %bb.0:
50+
; CHECK-NEXT: v128.const $push0=, 0, 0, 0, 0, 0, 0, 0, 0
51+
; CHECK-NEXT: i16x8.eq $push1=, $0, $pop0
52+
; CHECK-NEXT: v128.any_true $push2=, $pop1
53+
; CHECK-NEXT: i32.const $push3=, -1
54+
; CHECK-NEXT: i32.xor $push4=, $pop2, $pop3
55+
; CHECK-NEXT: i32.const $push5=, 1
56+
; CHECK-NEXT: i32.and $push6=, $pop4, $pop5
57+
; CHECK-NEXT: return $pop6
58+
%1 = icmp eq <8 x i16> %v, zeroinitializer
59+
%2 = bitcast <8 x i1> %1 to i8
60+
%3 = icmp eq i8 %2, 0
61+
%conv3 = zext i1 %3 to i32
62+
ret i32 %conv3
63+
}
64+
65+
66+
define i32 @all_true_4_i16(<4 x i16> %v) {
67+
; CHECK-LABEL: all_true_4_i16:
68+
; CHECK: .functype all_true_4_i16 (v128) -> (i32)
69+
; CHECK-NEXT: # %bb.0:
70+
; CHECK-NEXT: v128.const $push0=, 0, 0, 0, 0, 0, 0, 0, 0
71+
; CHECK-NEXT: i16x8.eq $push1=, $0, $pop0
72+
; CHECK-NEXT: i32x4.extend_low_i16x8_s $push2=, $pop1
73+
; CHECK-NEXT: v128.any_true $push3=, $pop2
74+
; CHECK-NEXT: i32.const $push4=, -1
75+
; CHECK-NEXT: i32.xor $push5=, $pop3, $pop4
76+
; CHECK-NEXT: i32.const $push6=, 1
77+
; CHECK-NEXT: i32.and $push7=, $pop5, $pop6
78+
; CHECK-NEXT: return $pop7
79+
%1 = icmp eq <4 x i16> %v, zeroinitializer
80+
%2 = bitcast <4 x i1> %1 to i4
81+
%3 = icmp eq i4 %2, 0
82+
%conv3 = zext i1 %3 to i32
83+
ret i32 %conv3
84+
}
85+
86+
87+
define i32 @all_true_2_i64(<2 x i64> %v) {
88+
; CHECK-LABEL: all_true_2_i64:
89+
; CHECK: .functype all_true_2_i64 (v128) -> (i32)
90+
; CHECK-NEXT: # %bb.0:
91+
; CHECK-NEXT: v128.const $push0=, 0, 0
92+
; CHECK-NEXT: i64x2.eq $push1=, $0, $pop0
93+
; CHECK-NEXT: v128.any_true $push2=, $pop1
94+
; CHECK-NEXT: i32.const $push3=, -1
95+
; CHECK-NEXT: i32.xor $push4=, $pop2, $pop3
96+
; CHECK-NEXT: i32.const $push5=, 1
97+
; CHECK-NEXT: i32.and $push6=, $pop4, $pop5
98+
; CHECK-NEXT: return $pop6
99+
%1 = icmp eq <2 x i64> %v, zeroinitializer
100+
%2 = bitcast <2 x i1> %1 to i2
101+
%3 = icmp eq i2 %2, 0
102+
%conv3 = zext i1 %3 to i32
103+
ret i32 %conv3
104+
}

0 commit comments

Comments
 (0)