File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
lib/Conversion/LLVMCommon
test/Conversion/VectorToLLVM Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -507,7 +507,8 @@ FailureOr<Type> LLVMTypeConverter::convertVectorType(VectorType type) const {
507
507
type.getScalableDims ().back ());
508
508
assert (LLVM::isCompatibleVectorType (vectorType) &&
509
509
" expected vector type compatible with the LLVM dialect" );
510
- if (type.isScalable () && (type.getRank () > 1 ))
510
+ // Only the trailing dimension can be scalable.
511
+ if (llvm::is_contained (type.getScalableDims ().drop_back (), true ))
511
512
return failure ();
512
513
auto shape = type.getShape ();
513
514
for (int i = shape.size () - 2 ; i >= 0 ; --i)
Original file line number Diff line number Diff line change @@ -2260,3 +2260,13 @@ func.func @vector_scalable_extract(%vec: vector<[4]xf32>) -> vector<8xf32> {
2260
2260
%0 = vector.scalable.extract %vec [0 ] : vector <8 xf32 > from vector <[4 ]xf32 >
2261
2261
return %0 : vector <8 xf32 >
2262
2262
}
2263
+
2264
+ // -----
2265
+
2266
+ // CHECK-LABEL: @make_fixed_vector_of_scalable_vector
2267
+ func.func @make_fixed_vector_of_scalable_vector (%f : f64 ) -> vector <3 x[2 ]xf64 >
2268
+ {
2269
+ // CHECK: %{{.*}} = llvm.mlir.undef : !llvm.array<3 x vector<[2]xf64>>
2270
+ %res = vector.broadcast %f : f64 to vector <3 x[2 ]xf64 >
2271
+ return %res : vector <3 x[2 ]xf64 >
2272
+ }
You can’t perform that action at this time.
0 commit comments