MLIR
20.0.0git
|
Namespaces | |
detail | |
Functions | |
std::unique_ptr< Pass > | createEnableArmStreamingPass (const ArmStreamingMode=ArmStreamingMode::Streaming, const ArmZaMode=ArmZaMode::Disabled, bool ifRequiredByOps=false, bool ifContainsScalableVectors=false) |
Pass to enable Armv9 Streaming SVE mode. More... | |
std::unique_ptr< Pass > | createOuterProductFusionPass () |
Pass that fuses 'arm_sme.outerproduct' ops into 2-way or 4-way widening variants. More... | |
std::unique_ptr< Pass > | createVectorLegalizationPass () |
Pass that legalizes vectors so they can be lowered to ArmSME. More... | |
void | populateOuterProductFusionPatterns (RewritePatternSet &patterns) |
LogicalResult | allocateSMETiles (FunctionOpInterface function, bool dumpRanges=false) |
Allocate tile IDs to all ArmSME operations in a function. More... | |
unsigned | getSMETileSliceMinNumElts (Type type) |
Return minimum number of elements for the given element type in a vector of SVL bits. More... | |
bool | isValidSMETileElementType (Type type) |
Returns true if type is a valid element type for an SME tile or false otherwise. More... | |
bool | isValidSMETileVectorType (VectorType vType) |
Returns true if vType is a valid vector type for an SME tile or false otherwise. More... | |
bool | isValidSMETileVectorType (Type 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 within an SME tile. More... | |
LogicalResult | verifyOperationHasValidTileId (Operation *) |
Verifies the tile ID (if set) on this tile operation is valid. More... | |
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 each iteration yields a new tile. More... | |
bool | isMultipleOfSMETileVectorType (VectorType vType) |
Returns true if vType is a multiple of an SME tile size. More... | |
VectorType | getSMETileTypeForElement (Type elementType) |
Creates a vector type for the SME tile of elementType . More... | |
void | eraseTriviallyDeadTileOps (IRRewriter &rewriter, FunctionOpInterface function) |
Erase trivially dead tile ops from a function. More... | |
bool | isTriviallyCloneableTileOp (arm_sme::ArmSMETileOpInterface tileOp) |
Returns true if tileOp is trivially cloneable. More... | |
bool | hasTileResult (arm_sme::ArmSMETileOpInterface tileOp) |
Returns true if tileOp produces a tile result. More... | |
OpOperand * | getTileOpOperand (arm_sme::ArmSMETileOpInterface tileOp) |
Returns the tile OpOperand for this tileOp (or null). More... | |
bool | isTileTypeGreaterOrEqual (ArmSMETileType typeA, ArmSMETileType typeB) |
Returns true typeA is >= (in terms of bytes) than typeB . More... | |
Variables | |
static constexpr unsigned | kInMemoryTileIdBase = 16 |
constexpr unsigned | MinStreamingVectorLengthInBits = 128 |
LogicalResult mlir::arm_sme::allocateSMETiles | ( | FunctionOpInterface | function, |
bool | dumpRanges = false |
||
) |
Allocate tile IDs to all ArmSME operations in a function.
Requires the function to be lowered to control flow (cf dialect).
Definition at line 799 of file TileAllocation.cpp.
References eraseTriviallyDeadTileOps(), and getContext().
std::unique_ptr< Pass > mlir::arm_sme::createEnableArmStreamingPass | ( | const ArmStreamingMode | streamingMode = ArmStreamingMode::Streaming , |
const ArmZaMode | zaMode = ArmZaMode::Disabled , |
||
bool | ifRequiredByOps = false , |
||
bool | ifContainsScalableVectors = false |
||
) |
Pass to enable Armv9 Streaming SVE mode.
Definition at line 143 of file EnableArmStreaming.cpp.
scf::ForOp mlir::arm_sme::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 each iteration yields a new tile.
Loop body is built via makeLoopBody
, which returns the next tile value.
Definition at line 75 of file Utils.cpp.
References mlir::OpBuilder::create(), mlir::Builder::getIndexType(), mlir::Value::getType(), and mlir::OpBuilder::setInsertionPointToStart().
std::unique_ptr< Pass > mlir::arm_sme::createOuterProductFusionPass | ( | ) |
Pass that fuses 'arm_sme.outerproduct' ops into 2-way or 4-way widening variants.
Definition at line 542 of file OuterProductFusion.cpp.
std::unique_ptr< Pass > mlir::arm_sme::createVectorLegalizationPass | ( | ) |
Pass that legalizes vectors so they can be lowered to ArmSME.
Definition at line 964 of file VectorLegalization.cpp.
void mlir::arm_sme::eraseTriviallyDeadTileOps | ( | IRRewriter & | rewriter, |
FunctionOpInterface | function | ||
) |
Erase trivially dead tile ops from a function.
Definition at line 119 of file Utils.cpp.
References mlir::RewriterBase::eraseOp(), mlir::Operation::getOperands(), and mlir::isOpTriviallyDead().
Referenced by allocateSMETiles().
unsigned mlir::arm_sme::getSMETileSliceMinNumElts | ( | Type | type | ) |
Return minimum number of elements for the given element type
in a vector of SVL bits.
Definition at line 18 of file Utils.cpp.
References mlir::Type::getIntOrFloatBitWidth(), isValidSMETileElementType(), and MinStreamingVectorLengthInBits.
Referenced by getSMETileTypeForElement(), isMultipleOfSMETileVectorType(), and isValidSMETileVectorType().
std::optional< ArmSMETileType > mlir::arm_sme::getSMETileType | ( | VectorType | type | ) |
Returns the type of SME tile this vector type corresponds to, or none if the vector type does not fit within an SME tile.
Definition at line 44 of file Utils.cpp.
References isValidSMETileVectorType().
VectorType mlir::arm_sme::getSMETileTypeForElement | ( | Type | elementType | ) |
Creates a vector type for the SME tile of elementType
.
Definition at line 114 of file Utils.cpp.
References mlir::get(), and getSMETileSliceMinNumElts().
OpOperand * mlir::arm_sme::getTileOpOperand | ( | arm_sme::ArmSMETileOpInterface | tileOp | ) |
Returns the tile OpOperand
for this tileOp
(or null).
Definition at line 152 of file Utils.cpp.
References isValidSMETileVectorType().
bool mlir::arm_sme::hasTileResult | ( | arm_sme::ArmSMETileOpInterface | tileOp | ) |
Returns true if tileOp
produces a tile result.
Definition at line 144 of file Utils.cpp.
References isValidSMETileVectorType().
bool mlir::arm_sme::isMultipleOfSMETileVectorType | ( | VectorType | vType | ) |
Returns true if vType
is a multiple of an SME tile size.
Returns false if the vType
exactly matches the size of an SME tile.
Definition at line 97 of file Utils.cpp.
References getSMETileSliceMinNumElts(), and isValidSMETileElementType().
bool mlir::arm_sme::isTileTypeGreaterOrEqual | ( | ArmSMETileType | typeA, |
ArmSMETileType | typeB | ||
) |
bool mlir::arm_sme::isTriviallyCloneableTileOp | ( | arm_sme::ArmSMETileOpInterface | tileOp | ) |
Returns true if tileOp
is trivially cloneable.
A tile operation is trivially cloneable if:
This ensures that the cloned operation will not share any dependencies with the original operation (which could also need to be considered), and that inserting the cloned operation at a different point in the program won't change the semantics of the program (as it has no side effects).
Definition at line 139 of file Utils.cpp.
References mlir::isPure().
bool mlir::arm_sme::isValidSMETileElementType | ( | Type | type | ) |
Returns true if type
is a valid element type for an SME tile or false otherwise.
Definition at line 23 of file Utils.cpp.
References mlir::Type::isBF16(), mlir::Type::isF128(), mlir::Type::isF16(), mlir::Type::isF32(), mlir::Type::isF64(), and mlir::Type::isInteger().
Referenced by getSMETileSliceMinNumElts(), isMultipleOfSMETileVectorType(), and isValidSMETileVectorType().
|
inline |
Definition at line 47 of file Utils.h.
References isValidSMETileVectorType().
bool mlir::arm_sme::isValidSMETileVectorType | ( | VectorType | vType | ) |
Returns true if vType
is a valid vector type for an SME tile or false otherwise.
Definition at line 29 of file Utils.cpp.
References getSMETileSliceMinNumElts(), and isValidSMETileElementType().
Referenced by getSMETileType(), getTileOpOperand(), hasTileResult(), isValidSMETileVectorType(), and mlir::populateArmSMEToLLVMConversionPatterns().
void mlir::arm_sme::populateOuterProductFusionPatterns | ( | RewritePatternSet & | patterns | ) |
Definition at line 533 of file OuterProductFusion.cpp.
References mlir::patterns.
LogicalResult mlir::arm_sme::verifyOperationHasValidTileId | ( | Operation * | op | ) |
Verifies the tile ID (if set) on this tile operation is valid.
Definition at line 63 of file Utils.cpp.
Referenced by mlir::arm_sme::detail::verifyArmSMETileOpInterface().
|
staticconstexpr |
Definition at line 22 of file ArmSMEOpInterfaces.h.
|
constexpr |
Definition at line 33 of file Utils.h.
Referenced by getSMETileSliceMinNumElts().