@@ -167,6 +167,33 @@ exit:
167
167
ret void
168
168
}
169
169
170
+ ; Negative test. Widening structs of vectors is not supported.
171
+ ; CHECK-REMARKS-COUNT: remark: {{.*}} loop not vectorized: instruction return type cannot be vectorized
172
+ define void @negative_struct_of_vectors (ptr noalias %in , ptr noalias writeonly %out_a , ptr noalias writeonly %out_b ) {
173
+ ; CHECK-LABEL: define void @negative_struct_of_vectors
174
+ ; CHECK-NOT: vector.body:
175
+ entry:
176
+ br label %for.body
177
+
178
+ for.body:
179
+ %iv = phi i64 [ 0 , %entry ], [ %iv.next , %for.body ]
180
+ %arrayidx = getelementptr inbounds float , ptr %in , i64 %iv
181
+ %in_val = load <1 x float >, ptr %arrayidx , align 4
182
+ %call = tail call { <1 x float >, <1 x float > } @foo (<1 x float > %in_val ) #0
183
+ %extract_a = extractvalue { <1 x float >, <1 x float > } %call , 0
184
+ %extract_b = extractvalue { <1 x float >, <1 x float > } %call , 1
185
+ %arrayidx2 = getelementptr inbounds float , ptr %out_a , i64 %iv
186
+ store <1 x float > %extract_a , ptr %arrayidx2 , align 4
187
+ %arrayidx4 = getelementptr inbounds float , ptr %out_b , i64 %iv
188
+ store <1 x float > %extract_b , ptr %arrayidx4 , align 4
189
+ %iv.next = add nuw nsw i64 %iv , 1
190
+ %exitcond.not = icmp eq i64 %iv.next , 1024
191
+ br i1 %exitcond.not , label %exit , label %for.body
192
+
193
+ exit:
194
+ ret void
195
+ }
196
+
170
197
; Negative test. Widening structs with mixed element types is not supported.
171
198
; CHECK-REMARKS-COUNT: remark: {{.*}} loop not vectorized: instruction return type cannot be vectorized
172
199
define void @negative_mixed_element_type_struct_return (ptr noalias %in , ptr noalias writeonly %out_a , ptr noalias writeonly %out_b ) {
@@ -361,6 +388,7 @@ declare %named_struct @bar_named(double)
361
388
declare { { float , float } } @foo_nested_struct (float )
362
389
declare { [2 x float ] } @foo_arrays (float )
363
390
declare { float , [1 x float ] } @foo_one_non_widenable_element (float )
391
+ declare { <1 x float >, <1 x float > } @foo_vectors (<1 x float >)
364
392
declare { i32 , i32 , i32 } @qux (i32 )
365
393
366
394
declare { <2 x float >, <2 x float > } @fixed_vec_foo (<2 x float >)
0 commit comments