@@ -50,13 +50,13 @@ define <4 x i8> @splat_binop_splat_x(<4 x i8> %x, <4 x i8> %y) {
50
50
; CHECK-LABEL: @splat_binop_splat_x(
51
51
; CHECK-NEXT: [[XSPLAT:%.*]] = shufflevector <4 x i8> [[X:%.*]], <4 x i8> poison, <4 x i32> zeroinitializer
52
52
; CHECK-NEXT: call void @use(<4 x i8> [[XSPLAT]])
53
- ; CHECK-NEXT: [[B :%.*]] = add <4 x i8> [[XSPLAT ]], [[Y:%.*]]
54
- ; CHECK-NEXT: [[BSPLAT:%.*]] = shufflevector <4 x i8> [[B ]], <4 x i8> poison, <4 x i32> zeroinitializer
53
+ ; CHECK-NEXT: [[TMP1 :%.*]] = add nsw <4 x i8> [[X ]], [[Y:%.*]]
54
+ ; CHECK-NEXT: [[BSPLAT:%.*]] = shufflevector <4 x i8> [[TMP1 ]], <4 x i8> poison, <4 x i32> zeroinitializer
55
55
; CHECK-NEXT: ret <4 x i8> [[BSPLAT]]
56
56
;
57
57
%xsplat = shufflevector <4 x i8 > %x , <4 x i8 > poison, <4 x i32 > zeroinitializer
58
58
call void @use (<4 x i8 > %xsplat )
59
- %b = add <4 x i8 > %xsplat , %y
59
+ %b = add nsw <4 x i8 > %xsplat , %y
60
60
%bsplat = shufflevector <4 x i8 > %b , <4 x i8 > poison, <4 x i32 > zeroinitializer
61
61
ret <4 x i8 > %bsplat
62
62
}
@@ -65,14 +65,14 @@ define <4 x i8> @splat_binop_splat_y(<4 x i8> %x, <4 x i8> %y) {
65
65
; CHECK-LABEL: @splat_binop_splat_y(
66
66
; CHECK-NEXT: [[YSPLAT:%.*]] = shufflevector <4 x i8> [[Y:%.*]], <4 x i8> poison, <4 x i32> zeroinitializer
67
67
; CHECK-NEXT: call void @use(<4 x i8> [[YSPLAT]])
68
- ; CHECK-NEXT: [[B :%.*]] = sub <4 x i8> [[X:%.*]], [[YSPLAT ]]
69
- ; CHECK-NEXT: [[BSPLAT:%.*]] = shufflevector <4 x i8> [[B ]], <4 x i8> poison, <4 x i32> zeroinitializer
68
+ ; CHECK-NEXT: [[TMP1 :%.*]] = sub <4 x i8> [[X:%.*]], [[Y ]]
69
+ ; CHECK-NEXT: [[BSPLAT:%.*]] = shufflevector <4 x i8> [[TMP1 ]], <4 x i8> poison, <4 x i32> <i32 undef, i32 0, i32 0, i32 0>
70
70
; CHECK-NEXT: ret <4 x i8> [[BSPLAT]]
71
71
;
72
72
%ysplat = shufflevector <4 x i8 > %y , <4 x i8 > poison, <4 x i32 > zeroinitializer
73
73
call void @use (<4 x i8 > %ysplat )
74
74
%b = sub <4 x i8 > %x , %ysplat
75
- %bsplat = shufflevector <4 x i8 > %b , <4 x i8 > poison, <4 x i32 > zeroinitializer
75
+ %bsplat = shufflevector <4 x i8 > %b , <4 x i8 > poison, <4 x i32 >< i32 poison, i32 0 , i32 0 , i32 0 >
76
76
ret <4 x i8 > %bsplat
77
77
}
78
78
@@ -82,21 +82,40 @@ define <4 x i8> @splat_binop_splat_x_splat_y(<4 x i8> %x, <4 x i8> %y) {
82
82
; CHECK-NEXT: call void @use(<4 x i8> [[XSPLAT]])
83
83
; CHECK-NEXT: [[YSPLAT:%.*]] = shufflevector <4 x i8> [[Y:%.*]], <4 x i8> poison, <4 x i32> zeroinitializer
84
84
; CHECK-NEXT: call void @use(<4 x i8> [[YSPLAT]])
85
- ; CHECK-NEXT: [[B :%.*]] = mul <4 x i8> [[XSPLAT ]], [[YSPLAT ]]
86
- ; CHECK-NEXT: [[BSPLAT:%.*]] = shufflevector <4 x i8> [[B ]], <4 x i8> poison, <4 x i32> zeroinitializer
85
+ ; CHECK-NEXT: [[TMP1 :%.*]] = mul nuw <4 x i8> [[Y ]], [[X ]]
86
+ ; CHECK-NEXT: [[BSPLAT:%.*]] = shufflevector <4 x i8> [[TMP1 ]], <4 x i8> poison, <4 x i32> zeroinitializer
87
87
; CHECK-NEXT: ret <4 x i8> [[BSPLAT]]
88
88
;
89
89
%xsplat = shufflevector <4 x i8 > %x , <4 x i8 > poison, <4 x i32 > zeroinitializer
90
90
call void @use (<4 x i8 > %xsplat )
91
91
%ysplat = shufflevector <4 x i8 > %y , <4 x i8 > poison, <4 x i32 > zeroinitializer
92
92
call void @use (<4 x i8 > %ysplat )
93
- %b = mul <4 x i8 > %xsplat , %ysplat
93
+ %b = mul nuw <4 x i8 > %xsplat , %ysplat
94
94
%bsplat = shufflevector <4 x i8 > %b , <4 x i8 > poison, <4 x i32 > zeroinitializer
95
95
ret <4 x i8 > %bsplat
96
96
}
97
97
98
- define <vscale x 4 x i32 > @vscale_splat_binop_splat_x (<vscale x 4 x i32 > %x , <vscale x 4 x i32 > %y ) {
99
- ; CHECK-LABEL: @vscale_splat_binop_splat_x(
98
+ define <4 x float > @splat_binop_splat_x_splat_y_fmath_flags (<4 x float > %x , <4 x float > %y ) {
99
+ ; CHECK-LABEL: @splat_binop_splat_x_splat_y_fmath_flags(
100
+ ; CHECK-NEXT: [[XSPLAT:%.*]] = shufflevector <4 x float> [[X:%.*]], <4 x float> poison, <4 x i32> zeroinitializer
101
+ ; CHECK-NEXT: call void @use(<4 x float> [[XSPLAT]])
102
+ ; CHECK-NEXT: [[YSPLAT:%.*]] = shufflevector <4 x float> [[Y:%.*]], <4 x float> poison, <4 x i32> zeroinitializer
103
+ ; CHECK-NEXT: call void @use(<4 x float> [[YSPLAT]])
104
+ ; CHECK-NEXT: [[TMP1:%.*]] = fmul fast <4 x float> [[Y]], [[X]]
105
+ ; CHECK-NEXT: [[BSPLAT:%.*]] = shufflevector <4 x float> [[TMP1]], <4 x float> poison, <4 x i32> zeroinitializer
106
+ ; CHECK-NEXT: ret <4 x float> [[BSPLAT]]
107
+ ;
108
+ %xsplat = shufflevector <4 x float > %x , <4 x float > poison, <4 x i32 > zeroinitializer
109
+ call void @use (<4 x float > %xsplat )
110
+ %ysplat = shufflevector <4 x float > %y , <4 x float > poison, <4 x i32 > zeroinitializer
111
+ call void @use (<4 x float > %ysplat )
112
+ %b = fmul fast <4 x float > %xsplat , %ysplat
113
+ %bsplat = shufflevector <4 x float > %b , <4 x float > poison, <4 x i32 > zeroinitializer
114
+ ret <4 x float > %bsplat
115
+ }
116
+
117
+ define <vscale x 4 x i32 > @vscale_splat_udiv_splat_x (<vscale x 4 x i32 > %x , <vscale x 4 x i32 > %y ) {
118
+ ; CHECK-LABEL: @vscale_splat_udiv_splat_x(
100
119
; CHECK-NEXT: [[XSPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[X:%.*]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
101
120
; CHECK-NEXT: [[B:%.*]] = udiv <vscale x 4 x i32> [[XSPLAT]], [[Y:%.*]]
102
121
; CHECK-NEXT: [[BSPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[B]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
@@ -108,6 +127,19 @@ define <vscale x 4 x i32> @vscale_splat_binop_splat_x(<vscale x 4 x i32> %x, <vs
108
127
ret <vscale x 4 x i32 > %bsplat
109
128
}
110
129
130
+ define <vscale x 4 x i32 > @vscale_splat_urem_splat_x (<vscale x 4 x i32 > %x , <vscale x 4 x i32 > %y ) {
131
+ ; CHECK-LABEL: @vscale_splat_urem_splat_x(
132
+ ; CHECK-NEXT: [[XSPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[X:%.*]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
133
+ ; CHECK-NEXT: [[B:%.*]] = urem <vscale x 4 x i32> [[XSPLAT]], [[Y:%.*]]
134
+ ; CHECK-NEXT: [[BSPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[B]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
135
+ ; CHECK-NEXT: ret <vscale x 4 x i32> [[BSPLAT]]
136
+ ;
137
+ %xsplat = shufflevector <vscale x 4 x i32 > %x , <vscale x 4 x i32 > poison, <vscale x 4 x i32 > zeroinitializer
138
+ %b = urem <vscale x 4 x i32 > %xsplat , %y
139
+ %bsplat = shufflevector <vscale x 4 x i32 > %b , <vscale x 4 x i32 > poison, <vscale x 4 x i32 > zeroinitializer
140
+ ret <vscale x 4 x i32 > %bsplat
141
+ }
142
+
111
143
define <vscale x 4 x i32 > @vscale_splat_binop_splat_y (<vscale x 4 x i32 > %x , <vscale x 4 x i32 > %y ) {
112
144
; CHECK-LABEL: @vscale_splat_binop_splat_y(
113
145
; CHECK-NEXT: [[YSPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[Y:%.*]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
@@ -140,8 +172,8 @@ define <vscale x 4 x i32> @vscale_splat_binop_splat_x_splat_y_calls(<vscale x 4
140
172
; CHECK-NEXT: call void @use_v(<vscale x 4 x i32> [[XSPLAT]])
141
173
; CHECK-NEXT: [[YSPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[Y:%.*]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
142
174
; CHECK-NEXT: call void @use_v(<vscale x 4 x i32> [[YSPLAT]])
143
- ; CHECK-NEXT: [[B :%.*]] = lshr <vscale x 4 x i32> [[XSPLAT ]], [[YSPLAT ]]
144
- ; CHECK-NEXT: [[BSPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[B ]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
175
+ ; CHECK-NEXT: [[TMP1 :%.*]] = lshr <vscale x 4 x i32> [[X ]], [[Y ]]
176
+ ; CHECK-NEXT: [[BSPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[TMP1 ]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
145
177
; CHECK-NEXT: ret <vscale x 4 x i32> [[BSPLAT]]
146
178
;
147
179
%xsplat = shufflevector <vscale x 4 x i32 > %x , <vscale x 4 x i32 > poison, <vscale x 4 x i32 > zeroinitializer
@@ -154,4 +186,4 @@ define <vscale x 4 x i32> @vscale_splat_binop_splat_x_splat_y_calls(<vscale x 4
154
186
}
155
187
156
188
declare void @use (<4 x i8 >)
157
- declare void @use_v (<vscale x 4 x i32 >)
189
+ declare void @use_v (<vscale x 4 x i32 >)
0 commit comments