30 if ((vType.getRank() != 2) || !vType.allDimsScalable())
33 auto elemType = vType.getElementType();
47 switch (type.getElementTypeBitWidth()) {
49 return ArmSMETileType::ZAB;
51 return ArmSMETileType::ZAH;
53 return ArmSMETileType::ZAS;
55 return ArmSMETileType::ZAD;
57 return ArmSMETileType::ZAQ;
59 llvm_unreachable(
"unknown SME tile type");
64 auto tileOp = llvm::dyn_cast<ArmSMETileOpInterface>(op);
67 auto tileId = tileOp.getTileId();
70 if (!tileId.getType().isSignlessInteger(32))
71 return tileOp.emitOpError(
"tile ID should be a 32-bit signless integer");
81 loc, llvm::cast<VectorType>(initTile.
getType()).getDimSize(0));
86 rewriter.
create<arith::MulIOp>(loc, minTileSlices, vscale);
87 auto forOp = rewriter.
create<scf::ForOp>(loc, lowerBound, numTileSlices, step,
91 makeLoopBody(rewriter, loc, forOp.getInductionVar(),
92 forOp.getRegionIterArg(0));
93 rewriter.
create<scf::YieldOp>(loc, nextTile);
98 if (vType.getRank() != 2 || !vType.allDimsScalable())
101 auto elementType = vType.getElementType();
107 int64_t vectorRows = vType.getDimSize(0);
108 int64_t vectorCols = vType.getDimSize(1);
110 return (vectorRows > minNumElts || vectorCols > minNumElts) &&
111 vectorRows % minNumElts == 0 && vectorCols % minNumElts == 0;
116 return VectorType::get({minNumElts, minNumElts}, elementType, {
true,
true});
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
RAII guard to reset the insertion point of the builder when destroyed.
This class helps build Operations.
void setInsertionPointToStart(Block *block)
Sets the insertion point to the start of the specified block.
Operation * create(const OperationState &state)
Creates an operation given the fields represented as an OperationState.
Operation is the basic unit of execution within MLIR.
A special type of RewriterBase that coordinates the application of a rewrite pattern on the current I...
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
bool isInteger() const
Return true if this is an integer type (with the specified width).
unsigned getIntOrFloatBitWidth() const
Return the bit width of an integer or a float type, assert failure on other types.
This class provides an abstraction over the different types of ranges over Values.
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Type getType() const
Return the type of this value.
Specialization of arith.constant op that returns an integer of index type.
std::optional< ArmSMETileType > getSMETileType(VectorType)
Returns the type of SME tile this vector type corresponds to, or none if the vector type does not fit...
VectorType getSMETileTypeForElement(Type elementType)
Creates a vector type for the SME tile of elementType.
unsigned getSMETileSliceMinNumElts(Type type)
Return minimum number of elements for the given element type in a vector of SVL bits.
bool isValidSMETileElementType(Type type)
Returns true if type is a valid element type for an SME tile or false otherwise.
bool isMultipleOfSMETileVectorType(VectorType vType)
Returns true if vType is a multiple of an SME tile size.
scf::ForOp createLoopOverTileSlices(PatternRewriter &rewriter, Location loc, Value initTile, std::function< Value(OpBuilder &, Location, Value, Value)> makeLoopBody)
Generates a for loop over ZA tile slices where the induction variable is the tile slice index and eac...
bool isValidSMETileVectorType(VectorType vType)
Returns true if vType is a valid vector type for an SME tile or false otherwise.
LogicalResult verifyOperationHasValidTileId(Operation *)
Verifies the tile ID (if set) on this tile operation is valid.
constexpr unsigned MinStreamingVectorLengthInBits
LogicalResult success(bool isSuccess=true)
Utility function to generate a LogicalResult.
auto get(MLIRContext *context, Ts &&...params)
Helper method that injects context only if needed, this helps unify some of the attribute constructio...
This class represents an efficient way to signal success or failure.