[mlir][VectorType] Remove numScalableDims from the vector type
This is a follow-up of https://reviews.llvm.org/D153372 in which `numScalableDims` (single integer) was effectively replaced with `isScalableDim` bitmask. This change is a part of a larger effort to enable scalable vectorisation in Linalg. See this RFC for more context: * https://discourse.llvm.org/t/rfc-scalable-vectorisation-in-linalg/ Differential Revision: https://reviews.llvm.org/D153412
This commit is contained in:
committed by
Andrzej Warzynski
parent
8de9c1ab51
commit
f22af204ed
@@ -31,21 +31,15 @@ using namespace mlir::vector;
|
||||
// Helper to reduce vector type by one rank at front.
|
||||
static VectorType reducedVectorTypeFront(VectorType tp) {
|
||||
assert((tp.getRank() > 1) && "unlowerable vector type");
|
||||
unsigned numScalableDims = tp.getNumScalableDims();
|
||||
if (tp.getShape().size() == numScalableDims)
|
||||
--numScalableDims;
|
||||
return VectorType::get(tp.getShape().drop_front(), tp.getElementType(),
|
||||
numScalableDims);
|
||||
tp.getScalableDims().drop_front());
|
||||
}
|
||||
|
||||
// Helper to reduce vector type by *all* but one rank at back.
|
||||
static VectorType reducedVectorTypeBack(VectorType tp) {
|
||||
assert((tp.getRank() > 1) && "unlowerable vector type");
|
||||
unsigned numScalableDims = tp.getNumScalableDims();
|
||||
if (numScalableDims > 0)
|
||||
--numScalableDims;
|
||||
return VectorType::get(tp.getShape().take_back(), tp.getElementType(),
|
||||
numScalableDims);
|
||||
tp.getScalableDims().take_back());
|
||||
}
|
||||
|
||||
// Helper that picks the proper sequence for inserting.
|
||||
|
||||
Reference in New Issue
Block a user