MLIR 23.0.0git
XeGPULayoutImpl.h File Reference

Go to the source code of this file.

Namespaces

namespace  mlir
 Include the generated interface declarations.
namespace  mlir::xegpu

Enumerations

enum class  mlir::xegpu::LayoutKind { mlir::xegpu::Lane , mlir::xegpu::InstData , mlir::xegpu::Subgroup }

Functions

LogicalResult mlir::xegpu::propagateLayouts (OpBuilder &builder, Operation *target, LayoutKind layoutKind, bool printOnly=false)
LogicalResult mlir::xegpu::resolveLayoutConflicts (Operation *target)
void mlir::xegpu::recoverTemporaryLayoutsDeprecated (Operation *op)
 [to-be-deprecated] Set the DistributeLayoutAttr for each OpOperand and OpResult of of the given operation.
bool mlir::xegpu::recoverTemporaryLayouts (Operation *rootOp)
 Attach layout attributes to all vector-type operands of operations within the given operation's nested region.
template<typename T, typename = std::enable_if_t<std::is_same_v<T, OpOperand> || std::is_same_v<T, OpResult>>>
void mlir::xegpu::removeLayoutAttr (const T &operandOrResult)
 Removes the LayoutAttr for a given OpOperand or OpResult if it exists.
void mlir::xegpu::removeLayoutAttrs (Operation *op)
 Removes the DistributeLayoutAttr for each OpOperand and OpResult of the given operation if they exist.
SmallVector< NamedAttributemlir::xegpu::dropSgLayoutAndDataOnAttrs (ArrayRef< NamedAttribute > attrs)
 Updates the NamedAttribute sequence by dropping sg-layout and sg-data information from any DistributeLayoutAttr found.
SmallVector< NamedAttributemlir::xegpu::dropInstDataOnAttrs (ArrayRef< NamedAttribute > attrs)
 Updates the NamedAttribute sequence by dropping inst-data information from any DistributeLayoutAttr found.
DistributeLayoutAttr mlir::xegpu::inferBroadcastSourceLayout (DistributeLayoutAttr resLayout, ArrayRef< int64_t > resShape, ArrayRef< int64_t > srcShape)
 Infers the source layout attribute for a broadcast operation given the result layout attribute, result shape, and source shape.
DistributeLayoutAttr mlir::xegpu::inferMultiReductionSourceLayout (DistributeLayoutAttr resLayout, SmallVector< int64_t > reduceDims)
 Infers the source layout attribute for a reduction operation given the result layout attribute and reduced dims.
DistributeLayoutAttr mlir::xegpu::inferBitCastSourceLayout (DistributeLayoutAttr resLayout, int resElemTyBitWidth, int srcElemTyBitWidth)
 Infers the source layout attribute for a bitcast operation given the result layout attribute, result element type bitwidth, and source element type bitwidth.
DistributeLayoutAttr mlir::xegpu::inferShapeCastSourceLayout (DistributeLayoutAttr resLayout, ArrayRef< int64_t > resShape, ArrayRef< int64_t > srcShape)
 Infers the source layout attribute for a shape cast operation given the result layout attribute, result shape, and source shape.
DistributeLayoutAttr mlir::xegpu::inferInsertStridedSliceSourceLayout (DistributeLayoutAttr resLayout, ArrayRef< int64_t > resShape, ArrayRef< int64_t > srcShape)
 Infers the source layout attribute for an insert strided slice operation given the result layout attribute, result shape, and source shape.
SliceAttr mlir::xegpu::setupMultiReductionResultLayout (LayoutKind layoutKind, VectorType srcVectorTy, DistributeLayoutAttr consumerLayout, SmallVector< int64_t > reductionDims, const uArch::uArch *uArch)
 Sets up layout for reduction operations by creating a SliceAttr for the result.
DistributeLayoutAttr mlir::xegpu::setupBitCastResultLayout (LayoutKind layoutKind, VectorType srcVectorTy, VectorType resVectorTy, DistributeLayoutAttr consumerLayout, const uArch::uArch *uArch)
 Setup the result layout attribute for a bitcast operation based on element type bitwidths.
DistributeLayoutAttr mlir::xegpu::setupInsertStridedSliceResultLayout (LayoutKind layoutKind, VectorType srcVectorTy, VectorType resVectorTy, DistributeLayoutAttr consumerLayout, const uArch::uArch *uArch)
 Sets up the result layout for an insert strided slice operation.
DistributeLayoutAttr mlir::xegpu::setupLoadGatherAnchorLayout (LayoutKind layoutKind, VectorType vectorTy, int chunkSize, DistributeLayoutAttr consumerLayout, const uArch::uArch *uArch)
 Sets up the anchor layout for a load gather operation.
DistributeLayoutAttr mlir::xegpu::setupLoadMatrixAnchorLayout (LayoutKind layoutKind, VectorType vectorTy, DistributeLayoutAttr consumerLayout, const uArch::uArch *uArch)
 Sets up the anchor layout for load matrix operation.
DistributeLayoutAttr mlir::xegpu::setupStoreScatterAnchorLayout (LayoutKind layoutKind, VectorType vectorTy, int chunkSize, const uArch::uArch *uArch)
 Sets up the anchor layout for a store scatter operation.
DistributeLayoutAttr mlir::xegpu::setupStoreMatrixAnchorLayout (LayoutKind layoutKind, VectorType vectorTy, const uArch::uArch *uArch)
 Sets up the anchor layout for a store matrix operation.
std::optional< std::tuple< DistributeLayoutAttr, DistributeLayoutAttr, DistributeLayoutAttr > > mlir::xegpu::setupDpasLayout (LayoutKind layoutKind, VectorType aTy, VectorType bTy, VectorType cdTy, DistributeLayoutAttr consumerLayout, const uArch::uArch *uArch, int numSg)
 Sets up the anchor layouts for a dpas operands (A, B, and C/D).