MLIR  19.0.0git
Functions | Variables
mlir::arm_sme Namespace Reference

Functions

std::unique_ptr< PasscreateEnableArmStreamingPass (const ArmStreamingMode=ArmStreamingMode::Streaming, const ArmZaMode=ArmZaMode::Disabled, bool onlyIfRequiredByOps=false)
 Pass to enable Armv9 Streaming SVE mode. More...
 
std::unique_ptr< PasscreateTileAllocationPass ()
 Pass that allocates tile IDs to ArmSME operations. More...
 
std::unique_ptr< PasscreateOuterProductFusionPass ()
 Pass that fuses 'arm_sme.outerproduct' ops into 2-way or 4-way widening variants. More...
 
std::unique_ptr< PasscreateVectorLegalizationPass ()
 Pass that legalizes vectors so they can be lowered to ArmSME. More...
 
void populateOuterProductFusionPatterns (RewritePatternSet &patterns)
 
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...
 
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...
 

Variables

static constexpr unsigned kInMemoryTileIdBase = 16
 
constexpr unsigned MinStreamingVectorLengthInBits = 128
 

Function Documentation

◆ createEnableArmStreamingPass()

std::unique_ptr< Pass > mlir::arm_sme::createEnableArmStreamingPass ( const ArmStreamingMode  streamingMode = ArmStreamingMode::Streaming,
const ArmZaMode  zaMode = ArmZaMode::Disabled,
bool  onlyIfRequiredByOps = false 
)

Pass to enable Armv9 Streaming SVE mode.

Definition at line 100 of file EnableArmStreaming.cpp.

◆ createLoopOverTileSlices()

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().

◆ createOuterProductFusionPass()

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 583 of file OuterProductFusion.cpp.

◆ createTileAllocationPass()

std::unique_ptr< Pass > mlir::arm_sme::createTileAllocationPass ( )

Pass that allocates tile IDs to ArmSME operations.

Definition at line 306 of file TileAllocation.cpp.

◆ createVectorLegalizationPass()

std::unique_ptr< Pass > mlir::arm_sme::createVectorLegalizationPass ( )

Pass that legalizes vectors so they can be lowered to ArmSME.

Definition at line 654 of file VectorLegalization.cpp.

◆ getSMETileSliceMinNumElts()

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().

◆ getSMETileType()

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().

◆ getSMETileTypeForElement()

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().

◆ isMultipleOfSMETileVectorType()

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().

◆ isValidSMETileElementType()

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().

◆ 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(), and mlir::populateArmSMEToLLVMConversionPatterns().

◆ populateOuterProductFusionPatterns()

void mlir::arm_sme::populateOuterProductFusionPatterns ( RewritePatternSet patterns)

◆ verifyOperationHasValidTileId()

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.

Variable Documentation

◆ kInMemoryTileIdBase

constexpr unsigned mlir::arm_sme::kInMemoryTileIdBase = 16
staticconstexpr

Definition at line 28 of file ArmSME.h.

◆ MinStreamingVectorLengthInBits

constexpr unsigned mlir::arm_sme::MinStreamingVectorLengthInBits = 128
constexpr

Definition at line 31 of file Utils.h.

Referenced by getSMETileSliceMinNumElts().