Files
gps/tools/local/circt/include/mlir/Dialect/XeGPU/IR/XeGPUAttrInterface.h.inc
T
2026-07-12 11:01:51 +03:00

582 lines
44 KiB
C++

/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
|* *|
|* Interface Declarations *|
|* *|
|* Automatically generated file, do not edit! *|
|* *|
\*===----------------------------------------------------------------------===*/
namespace mlir::xegpu {
/// Common trait for all XeGPU layouts.
class DistributeLayoutAttr;
} // namespace mlir::xegpu
namespace mlir::xegpu {
/// Common trait for all XeGPU layouts.
namespace detail {
struct DistributeLayoutAttrInterfaceTraits {
struct Concept {
/// The methods defined by the interface.
bool (*isForWorkgroup)(const Concept *impl, ::mlir::Attribute );
bool (*isForSubgroup)(const Concept *impl, ::mlir::Attribute );
bool (*isForLane)(const Concept *impl, ::mlir::Attribute );
int64_t (*getRank)(const Concept *impl, ::mlir::Attribute );
int64_t (*getNumSubgroups)(const Concept *impl, ::mlir::Attribute );
DenseI32ArrayAttr (*getOrder)(const Concept *impl, ::mlir::Attribute );
SmallVector<int64_t> (*getEffectiveSgLayoutAsInt)(const Concept *impl, ::mlir::Attribute );
SmallVector<int64_t> (*getEffectiveSgDataAsInt)(const Concept *impl, ::mlir::Attribute );
SmallVector<int64_t> (*getEffectiveInstDataAsInt)(const Concept *impl, ::mlir::Attribute );
SmallVector<int64_t> (*getEffectiveLaneLayoutAsInt)(const Concept *impl, ::mlir::Attribute );
SmallVector<int64_t> (*getEffectiveLaneDataAsInt)(const Concept *impl, ::mlir::Attribute );
SmallVector<int64_t> (*getEffectiveOrderAsInt)(const Concept *impl, ::mlir::Attribute );
xegpu::DistributeLayoutAttr (*dropSgLayoutAndData)(const Concept *impl, ::mlir::Attribute );
xegpu::DistributeLayoutAttr (*dropInstData)(const Concept *impl, ::mlir::Attribute );
xegpu::DistributeLayoutAttr (*setUnitDimData)(const Concept *impl, ::mlir::Attribute , const SmallVector<int64_t>);
xegpu::DistributeLayoutAttr (*setUnitDimLayout)(const Concept *impl, ::mlir::Attribute , const SmallVector<int64_t>);
FailureOr<SmallVector<Value>> (*delinearizeId)(const Concept *impl, ::mlir::Attribute , OpBuilder &, Location, Value);
xegpu::DistributeLayoutAttr (*setDimData)(const Concept *impl, ::mlir::Attribute , int64_t, int64_t, int64_t, int64_t);
xegpu::DistributeLayoutAttr (*dropDims)(const Concept *impl, ::mlir::Attribute , SmallVector<int64_t>);
xegpu::DistributeLayoutAttr (*collapseDims)(const Concept *impl, ::mlir::Attribute , SmallVector<int64_t>);
xegpu::DistributeLayoutAttr (*expandDim)(const Concept *impl, ::mlir::Attribute , int64_t, ArrayRef<int64_t>);
xegpu::DistributeLayoutAttr (*transposeDims)(const Concept *impl, ::mlir::Attribute , ArrayRef<int64_t>);
FailureOr<SmallVector<SmallVector<Value>>> (*computeDistributedCoords)(const Concept *impl, ::mlir::Attribute , OpBuilder &, Location, Value, ArrayRef<int64_t>);
SmallVector<SmallVector<int64_t>> (*computeStaticDistributedCoords)(const Concept *impl, ::mlir::Attribute , int64_t, ArrayRef<int64_t>);
FailureOr<SmallVector<int64_t>> (*computeDistributedShape)(const Concept *impl, ::mlir::Attribute , SmallVector<int64_t>);
bool (*isDistributable)(const Concept *impl, ::mlir::Attribute , SmallVector<int64_t>);
bool (*isSliceOf)(const Concept *impl, ::mlir::Attribute , const xegpu::DistributeLayoutAttr&);
bool (*isTransposeOf)(const Concept *impl, ::mlir::Attribute , const xegpu::DistributeLayoutAttr&, ArrayRef<int64_t>, xegpu::LayoutKind);
bool (*isCompatibleWith)(const Concept *impl, ::mlir::Attribute , const xegpu::DistributeLayoutAttr&, SmallVector<int64_t>, xegpu::LayoutKind);
bool (*isEqualTo)(const Concept *impl, ::mlir::Attribute , const xegpu::DistributeLayoutAttr&);
};
template<typename ConcreteAttr>
class Model : public Concept {
public:
using Interface = ::mlir::xegpu::DistributeLayoutAttr;
Model() : Concept{isForWorkgroup, isForSubgroup, isForLane, getRank, getNumSubgroups, getOrder, getEffectiveSgLayoutAsInt, getEffectiveSgDataAsInt, getEffectiveInstDataAsInt, getEffectiveLaneLayoutAsInt, getEffectiveLaneDataAsInt, getEffectiveOrderAsInt, dropSgLayoutAndData, dropInstData, setUnitDimData, setUnitDimLayout, delinearizeId, setDimData, dropDims, collapseDims, expandDim, transposeDims, computeDistributedCoords, computeStaticDistributedCoords, computeDistributedShape, isDistributable, isSliceOf, isTransposeOf, isCompatibleWith, isEqualTo} {}
static inline bool isForWorkgroup(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline bool isForSubgroup(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline bool isForLane(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline int64_t getRank(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline int64_t getNumSubgroups(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline DenseI32ArrayAttr getOrder(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline SmallVector<int64_t> getEffectiveSgLayoutAsInt(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline SmallVector<int64_t> getEffectiveSgDataAsInt(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline SmallVector<int64_t> getEffectiveInstDataAsInt(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline SmallVector<int64_t> getEffectiveLaneLayoutAsInt(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline SmallVector<int64_t> getEffectiveLaneDataAsInt(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline SmallVector<int64_t> getEffectiveOrderAsInt(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline xegpu::DistributeLayoutAttr dropSgLayoutAndData(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline xegpu::DistributeLayoutAttr dropInstData(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline xegpu::DistributeLayoutAttr setUnitDimData(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, const SmallVector<int64_t> unitDims);
static inline xegpu::DistributeLayoutAttr setUnitDimLayout(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, const SmallVector<int64_t> unitDims);
static inline FailureOr<SmallVector<Value>> delinearizeId(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, OpBuilder & builder, Location loc, Value linearId);
static inline xegpu::DistributeLayoutAttr setDimData(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, int64_t dim, int64_t sgData, int64_t instData, int64_t laneData);
static inline xegpu::DistributeLayoutAttr dropDims(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, SmallVector<int64_t> dimGroup);
static inline xegpu::DistributeLayoutAttr collapseDims(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, SmallVector<int64_t> dimGroup);
static inline xegpu::DistributeLayoutAttr expandDim(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, int64_t dim, ArrayRef<int64_t> targetShape);
static inline xegpu::DistributeLayoutAttr transposeDims(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, ArrayRef<int64_t> permutation);
static inline FailureOr<SmallVector<SmallVector<Value>>> computeDistributedCoords(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, OpBuilder & builder, Location loc, Value linearId, ArrayRef<int64_t> shape);
static inline SmallVector<SmallVector<int64_t>> computeStaticDistributedCoords(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, int64_t linearId, ArrayRef<int64_t> shape);
static inline FailureOr<SmallVector<int64_t>> computeDistributedShape(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, SmallVector<int64_t> shape);
static inline bool isDistributable(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, SmallVector<int64_t> shape);
static inline bool isSliceOf(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, const xegpu::DistributeLayoutAttr& other);
static inline bool isTransposeOf(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, const xegpu::DistributeLayoutAttr& other, ArrayRef<int64_t> perm, xegpu::LayoutKind kind);
static inline bool isCompatibleWith(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, const xegpu::DistributeLayoutAttr& other, SmallVector<int64_t> shape, xegpu::LayoutKind level);
static inline bool isEqualTo(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, const xegpu::DistributeLayoutAttr& other);
};
template<typename ConcreteAttr>
class FallbackModel : public Concept {
public:
using Interface = ::mlir::xegpu::DistributeLayoutAttr;
FallbackModel() : Concept{isForWorkgroup, isForSubgroup, isForLane, getRank, getNumSubgroups, getOrder, getEffectiveSgLayoutAsInt, getEffectiveSgDataAsInt, getEffectiveInstDataAsInt, getEffectiveLaneLayoutAsInt, getEffectiveLaneDataAsInt, getEffectiveOrderAsInt, dropSgLayoutAndData, dropInstData, setUnitDimData, setUnitDimLayout, delinearizeId, setDimData, dropDims, collapseDims, expandDim, transposeDims, computeDistributedCoords, computeStaticDistributedCoords, computeDistributedShape, isDistributable, isSliceOf, isTransposeOf, isCompatibleWith, isEqualTo} {}
static inline bool isForWorkgroup(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline bool isForSubgroup(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline bool isForLane(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline int64_t getRank(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline int64_t getNumSubgroups(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline DenseI32ArrayAttr getOrder(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline SmallVector<int64_t> getEffectiveSgLayoutAsInt(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline SmallVector<int64_t> getEffectiveSgDataAsInt(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline SmallVector<int64_t> getEffectiveInstDataAsInt(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline SmallVector<int64_t> getEffectiveLaneLayoutAsInt(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline SmallVector<int64_t> getEffectiveLaneDataAsInt(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline SmallVector<int64_t> getEffectiveOrderAsInt(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline xegpu::DistributeLayoutAttr dropSgLayoutAndData(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline xegpu::DistributeLayoutAttr dropInstData(const Concept *impl, ::mlir::Attribute tablegen_opaque_val);
static inline xegpu::DistributeLayoutAttr setUnitDimData(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, const SmallVector<int64_t> unitDims);
static inline xegpu::DistributeLayoutAttr setUnitDimLayout(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, const SmallVector<int64_t> unitDims);
static inline FailureOr<SmallVector<Value>> delinearizeId(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, OpBuilder & builder, Location loc, Value linearId);
static inline xegpu::DistributeLayoutAttr setDimData(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, int64_t dim, int64_t sgData, int64_t instData, int64_t laneData);
static inline xegpu::DistributeLayoutAttr dropDims(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, SmallVector<int64_t> dimGroup);
static inline xegpu::DistributeLayoutAttr collapseDims(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, SmallVector<int64_t> dimGroup);
static inline xegpu::DistributeLayoutAttr expandDim(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, int64_t dim, ArrayRef<int64_t> targetShape);
static inline xegpu::DistributeLayoutAttr transposeDims(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, ArrayRef<int64_t> permutation);
static inline FailureOr<SmallVector<SmallVector<Value>>> computeDistributedCoords(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, OpBuilder & builder, Location loc, Value linearId, ArrayRef<int64_t> shape);
static inline SmallVector<SmallVector<int64_t>> computeStaticDistributedCoords(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, int64_t linearId, ArrayRef<int64_t> shape);
static inline FailureOr<SmallVector<int64_t>> computeDistributedShape(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, SmallVector<int64_t> shape);
static inline bool isDistributable(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, SmallVector<int64_t> shape);
static inline bool isSliceOf(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, const xegpu::DistributeLayoutAttr& other);
static inline bool isTransposeOf(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, const xegpu::DistributeLayoutAttr& other, ArrayRef<int64_t> perm, xegpu::LayoutKind kind);
static inline bool isCompatibleWith(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, const xegpu::DistributeLayoutAttr& other, SmallVector<int64_t> shape, xegpu::LayoutKind level);
static inline bool isEqualTo(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, const xegpu::DistributeLayoutAttr& other);
};
template<typename ConcreteModel, typename ConcreteAttr>
class ExternalModel : public FallbackModel<ConcreteModel> {
public:
using ConcreteEntity = ConcreteAttr;
};
};
template <typename ConcreteAttr>
struct DistributeLayoutAttrTrait;
} // namespace detail
class DistributeLayoutAttr : public ::mlir::AttributeInterface<DistributeLayoutAttr, detail::DistributeLayoutAttrInterfaceTraits> {
public:
using ::mlir::AttributeInterface<DistributeLayoutAttr, detail::DistributeLayoutAttrInterfaceTraits>::AttributeInterface;
template <typename ConcreteAttr>
struct Trait : public detail::DistributeLayoutAttrTrait<ConcreteAttr> {};
/// Check the availability of workgroup level layouts
bool isForWorkgroup() const;
/// Check the availability of subgroup level layouts
bool isForSubgroup() const;
/// Check the availability of lane level layouts
bool isForLane() const;
/// Get the rank of attribute
int64_t getRank() const;
/// Get the num of effective subgroups
int64_t getNumSubgroups() const;
/// Get the order of the layout attribute
DenseI32ArrayAttr getOrder() const;
/// Get the effective SgLayout of the layout attribute as integer array
SmallVector<int64_t> getEffectiveSgLayoutAsInt() const;
/// Get the effective SgData of the layout attribute as integer array
SmallVector<int64_t> getEffectiveSgDataAsInt() const;
/// Get the effective InstData of the layout attribute as integer array
SmallVector<int64_t> getEffectiveInstDataAsInt() const;
/// Get the effective LaneLayout of the layout attribute as integer array
SmallVector<int64_t> getEffectiveLaneLayoutAsInt() const;
/// Get the effective LaneData of the layout attribute as integer array
SmallVector<int64_t> getEffectiveLaneDataAsInt() const;
/// Get the effective order of the layout attribute as integer array
SmallVector<int64_t> getEffectiveOrderAsInt() const;
/// Derive a new layout by dropping sgLayout and sgData
xegpu::DistributeLayoutAttr dropSgLayoutAndData() const;
/// Derive a new layout by dropping InstData
xegpu::DistributeLayoutAttr dropInstData() const;
/// Derive a new layout with sg_data, inst_data and lane_data set to 1 for the specified unit dims
xegpu::DistributeLayoutAttr setUnitDimData(const SmallVector<int64_t> unitDims) const;
/// Derive a new layout with sg_lane and lane_layout set to 1 for the specified unit dims
xegpu::DistributeLayoutAttr setUnitDimLayout(const SmallVector<int64_t> unitDims) const;
/// Delinearizes a linear ID into its multidimensional
/// indices based on the effective layout level.
FailureOr<SmallVector<Value>> delinearizeId(OpBuilder & builder, Location loc, Value linearId) const;
/// Derive a new layout with sg_data, inst_data and lane_data set to the
/// specified values for the given dimension. Passing -1 for any parameter
/// preserves its original value.
xegpu::DistributeLayoutAttr setDimData(int64_t dim, int64_t sgData, int64_t instData, int64_t laneData) const;
/// Derive a new layout by removing dimensions.
/// `dimGroup` specifies a group of dimensions to be removed in the derived layout.
xegpu::DistributeLayoutAttr dropDims(SmallVector<int64_t> dimGroup) const;
/// Derive a new layout by collapsing dimensions.
/// `dimGroup` specifies a group of adjacent dimensions that are collapsed into
/// a single dimension in the derived layout.
xegpu::DistributeLayoutAttr collapseDims(SmallVector<int64_t> dimGroup) const;
/// Derive a new layout by expanding a single dimension into
/// multiple adjacent dimensions whose extents are given by `targetShape`
/// (`product(targetShape) == originalSize` on `dim`). The original layout's
/// per-dim values on `dim` are distributed across the new dims:
/// `sg_layout` and `lane_layout` spread outer-to-inner (capped per dim by
/// `targetShape[i]`); `sg_data`, `lane_data`, and `inst_data` fill innermost-
/// first; `inst_data` is seeded from `lane_layout * lane_data` per new dim.
/// `order`, when present, is rewritten so the expanded dims appear
/// innermost-fastest in the original dim's slot; if the input has no
/// `order`, the result has no `order` either (the default FCD-first
/// order `[rank-1, ..., 0]` is assumed).
/// Example: layout<sg_layout=[2, 16], sg_data=[1, 1]> with
/// expandDim(1, [2, 8]) -> layout<sg_layout=[2, 2, 8], sg_data=[1, 1, 1]>
/// (no order in, no order out).
xegpu::DistributeLayoutAttr expandDim(int64_t dim, ArrayRef<int64_t> targetShape) const;
/// Derive a new layout by trasnposing it using `permutation`.
xegpu::DistributeLayoutAttr transposeDims(ArrayRef<int64_t> permutation) const;
/// Generates instructions to compute multidimensional coordinates for dist units
/// assigned to a level identified by linearId. The shape parameter
/// represents the higher-level problem size. Each level may access
/// multiple blocks according to round-robin distribution rules.
FailureOr<SmallVector<SmallVector<Value>>> computeDistributedCoords(OpBuilder & builder, Location loc, Value linearId, ArrayRef<int64_t> shape) const;
/// Statically computes multidimensional coordinates for all dist units
/// assigned to a compute unit identified by `linearId`. This is the
/// compile-time counterpart of `computeDistributedCoords`: it performs
/// the same delinearization and round-robin enumeration but operates
/// entirely on static integer values. Returns a list of coordinate
/// vectors, one per dist unit.
SmallVector<SmallVector<int64_t>> computeStaticDistributedCoords(int64_t linearId, ArrayRef<int64_t> shape) const;
/// Computes the distributed shape for each compute unit by dividing each
/// dimension of `shape` by the corresponding layout factor (sg_layout or
/// lane_layout).
/// The distributed shape represents the per-compute-unit tile. Each
/// distribution unit is defined as the combination of layout factors and
/// per-unit data (`subshape`, e.g., sg_data or lane_data). When `shape`
/// spans multiple distribution units, the distributed shape may contain
/// multiple such units.
/// For wrap-around dimensions where the division is uneven, the tensor tile
/// is broadcast to all subgroups/lanes.
FailureOr<SmallVector<int64_t>> computeDistributedShape(SmallVector<int64_t> shape) const;
/// Checks if the given shape can be distributed by the layout
bool isDistributable(SmallVector<int64_t> shape) const;
/// Check if this layout is a slice of another layout.
bool isSliceOf(const xegpu::DistributeLayoutAttr& other) const;
/// Check if this layout is a transpose of
/// the other layout according to given permutation of (0...n-1).
bool isTransposeOf(const xegpu::DistributeLayoutAttr& other, ArrayRef<int64_t> perm, xegpu::LayoutKind kind) const;
/// Check if this layout is compatible with another layout
/// at a specific level of the layout hierarchy regarding a given shape.
bool isCompatibleWith(const xegpu::DistributeLayoutAttr& other, SmallVector<int64_t> shape, xegpu::LayoutKind level) const;
/// Check if this layout is equal to another layout.
/// For LayoutAttr, this compares all fields.
/// For SliceAttr, this requires the same parent and same sliced dims.
bool isEqualTo(const xegpu::DistributeLayoutAttr& other) const;
};
} // namespace mlir::xegpu
namespace mlir::xegpu::detail {
template <typename ConcreteAttr>
struct DistributeLayoutAttrTrait : public ::mlir::AttributeInterface<DistributeLayoutAttr, detail::DistributeLayoutAttrInterfaceTraits>::Trait<ConcreteAttr> {
};
} // namespace mlir::xegpu::detail
namespace mlir::xegpu {
template<typename ConcreteAttr>
bool detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::isForWorkgroup(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).isForWorkgroup();
}
template<typename ConcreteAttr>
bool detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::isForSubgroup(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).isForSubgroup();
}
template<typename ConcreteAttr>
bool detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::isForLane(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).isForLane();
}
template<typename ConcreteAttr>
int64_t detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::getRank(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).getRank();
}
template<typename ConcreteAttr>
int64_t detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::getNumSubgroups(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).getNumSubgroups();
}
template<typename ConcreteAttr>
DenseI32ArrayAttr detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::getOrder(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).getOrder();
}
template<typename ConcreteAttr>
SmallVector<int64_t> detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::getEffectiveSgLayoutAsInt(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).getEffectiveSgLayoutAsInt();
}
template<typename ConcreteAttr>
SmallVector<int64_t> detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::getEffectiveSgDataAsInt(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).getEffectiveSgDataAsInt();
}
template<typename ConcreteAttr>
SmallVector<int64_t> detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::getEffectiveInstDataAsInt(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).getEffectiveInstDataAsInt();
}
template<typename ConcreteAttr>
SmallVector<int64_t> detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::getEffectiveLaneLayoutAsInt(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).getEffectiveLaneLayoutAsInt();
}
template<typename ConcreteAttr>
SmallVector<int64_t> detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::getEffectiveLaneDataAsInt(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).getEffectiveLaneDataAsInt();
}
template<typename ConcreteAttr>
SmallVector<int64_t> detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::getEffectiveOrderAsInt(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).getEffectiveOrderAsInt();
}
template<typename ConcreteAttr>
xegpu::DistributeLayoutAttr detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::dropSgLayoutAndData(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).dropSgLayoutAndData();
}
template<typename ConcreteAttr>
xegpu::DistributeLayoutAttr detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::dropInstData(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).dropInstData();
}
template<typename ConcreteAttr>
xegpu::DistributeLayoutAttr detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::setUnitDimData(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, const SmallVector<int64_t> unitDims) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).setUnitDimData(unitDims);
}
template<typename ConcreteAttr>
xegpu::DistributeLayoutAttr detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::setUnitDimLayout(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, const SmallVector<int64_t> unitDims) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).setUnitDimLayout(unitDims);
}
template<typename ConcreteAttr>
FailureOr<SmallVector<Value>> detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::delinearizeId(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, OpBuilder & builder, Location loc, Value linearId) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).delinearizeId(builder, loc, linearId);
}
template<typename ConcreteAttr>
xegpu::DistributeLayoutAttr detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::setDimData(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, int64_t dim, int64_t sgData, int64_t instData, int64_t laneData) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).setDimData(dim, sgData, instData, laneData);
}
template<typename ConcreteAttr>
xegpu::DistributeLayoutAttr detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::dropDims(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, SmallVector<int64_t> dimGroup) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).dropDims(dimGroup);
}
template<typename ConcreteAttr>
xegpu::DistributeLayoutAttr detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::collapseDims(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, SmallVector<int64_t> dimGroup) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).collapseDims(dimGroup);
}
template<typename ConcreteAttr>
xegpu::DistributeLayoutAttr detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::expandDim(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, int64_t dim, ArrayRef<int64_t> targetShape) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).expandDim(dim, targetShape);
}
template<typename ConcreteAttr>
xegpu::DistributeLayoutAttr detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::transposeDims(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, ArrayRef<int64_t> permutation) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).transposeDims(permutation);
}
template<typename ConcreteAttr>
FailureOr<SmallVector<SmallVector<Value>>> detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::computeDistributedCoords(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, OpBuilder & builder, Location loc, Value linearId, ArrayRef<int64_t> shape) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).computeDistributedCoords(builder, loc, linearId, shape);
}
template<typename ConcreteAttr>
SmallVector<SmallVector<int64_t>> detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::computeStaticDistributedCoords(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, int64_t linearId, ArrayRef<int64_t> shape) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).computeStaticDistributedCoords(linearId, shape);
}
template<typename ConcreteAttr>
FailureOr<SmallVector<int64_t>> detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::computeDistributedShape(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, SmallVector<int64_t> shape) {
SmallVector<int64_t> layout;
SmallVector<int64_t> subShape;
if ((::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).isForWorkgroup()) {
layout = (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).getEffectiveSgLayoutAsInt();
subShape = (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).getEffectiveSgDataAsInt();
} else if ((::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).isForSubgroup()) {
layout = (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).getEffectiveLaneLayoutAsInt();
subShape = (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).getEffectiveLaneDataAsInt();
} else {
return failure();
}
// sgdata or lanedata cannot be empty for distributed shape computation
if (subShape.empty())
return failure();
SmallVector<int64_t> distributedShape(shape.size());
for (auto [i, dim] : llvm::enumerate(shape)) {
int64_t distriUnit = layout[i]*subShape[i];
if ((dim % distriUnit) == 0) {
// Evenly divisible case, divide the dimension by the layout factor.
distributedShape[i] = dim / layout[i];
if (distributedShape[i] % subShape[i] != 0)
return failure();
} else {
// wrap around case, the dimension size must be equal to subShape value
if(dim != subShape[i])
return failure();
distributedShape[i] = dim;
}
}
return distributedShape;
}
template<typename ConcreteAttr>
bool detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::isDistributable(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, SmallVector<int64_t> shape) {
DistributeLayoutAttr curLayoutAttr = (::llvm::cast<ConcreteAttr>(tablegen_opaque_val));
SmallVector<int64_t> curShape = shape;
// Phase 1: Distribute across subgroups (sg_layout + sg_data).
if (curLayoutAttr.isForWorkgroup()) {
auto maybeSgShape = curLayoutAttr.computeDistributedShape(curShape);
if (failed(maybeSgShape))
return false;
curShape = maybeSgShape.value();
curLayoutAttr = curLayoutAttr.dropSgLayoutAndData();
if (!curLayoutAttr)
return true;
}
// Phase 2: Distribute across instruction data (inst_data).
if (curLayoutAttr.isForSubgroup() && !curLayoutAttr.isForLane()) {
SmallVector<int64_t> instData = curLayoutAttr.getEffectiveInstDataAsInt();
for (size_t i = 0; i < curShape.size(); ++i) {
if (curShape[i] % instData[i] != 0)
return false;
}
// inst_data becomes the new shape for next phase
curShape = instData;
curLayoutAttr = curLayoutAttr.dropInstData();
if (!curLayoutAttr)
return true;
}
// Phase 3: Distribute across lanes (lane_layout + lane_data).
auto maybeLaneShape = curLayoutAttr.computeDistributedShape(curShape);
return succeeded(maybeLaneShape);
}
template<typename ConcreteAttr>
bool detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::isSliceOf(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, const xegpu::DistributeLayoutAttr& other) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).isSliceOf(other);
}
template<typename ConcreteAttr>
bool detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::isTransposeOf(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, const xegpu::DistributeLayoutAttr& other, ArrayRef<int64_t> perm, xegpu::LayoutKind kind) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).isTransposeOf(other, perm, kind);
}
template<typename ConcreteAttr>
bool detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::isCompatibleWith(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, const xegpu::DistributeLayoutAttr& other, SmallVector<int64_t> shape, xegpu::LayoutKind level) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).isCompatibleWith(other, shape, level);
}
template<typename ConcreteAttr>
bool detail::DistributeLayoutAttrInterfaceTraits::Model<ConcreteAttr>::isEqualTo(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, const xegpu::DistributeLayoutAttr& other) {
return (::llvm::cast<ConcreteAttr>(tablegen_opaque_val)).isEqualTo(other);
}
template<typename ConcreteAttr>
bool detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::isForWorkgroup(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return static_cast<const ConcreteAttr *>(impl)->isForWorkgroup(tablegen_opaque_val);
}
template<typename ConcreteAttr>
bool detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::isForSubgroup(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return static_cast<const ConcreteAttr *>(impl)->isForSubgroup(tablegen_opaque_val);
}
template<typename ConcreteAttr>
bool detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::isForLane(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return static_cast<const ConcreteAttr *>(impl)->isForLane(tablegen_opaque_val);
}
template<typename ConcreteAttr>
int64_t detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::getRank(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return static_cast<const ConcreteAttr *>(impl)->getRank(tablegen_opaque_val);
}
template<typename ConcreteAttr>
int64_t detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::getNumSubgroups(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return static_cast<const ConcreteAttr *>(impl)->getNumSubgroups(tablegen_opaque_val);
}
template<typename ConcreteAttr>
DenseI32ArrayAttr detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::getOrder(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return static_cast<const ConcreteAttr *>(impl)->getOrder(tablegen_opaque_val);
}
template<typename ConcreteAttr>
SmallVector<int64_t> detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::getEffectiveSgLayoutAsInt(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return static_cast<const ConcreteAttr *>(impl)->getEffectiveSgLayoutAsInt(tablegen_opaque_val);
}
template<typename ConcreteAttr>
SmallVector<int64_t> detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::getEffectiveSgDataAsInt(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return static_cast<const ConcreteAttr *>(impl)->getEffectiveSgDataAsInt(tablegen_opaque_val);
}
template<typename ConcreteAttr>
SmallVector<int64_t> detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::getEffectiveInstDataAsInt(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return static_cast<const ConcreteAttr *>(impl)->getEffectiveInstDataAsInt(tablegen_opaque_val);
}
template<typename ConcreteAttr>
SmallVector<int64_t> detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::getEffectiveLaneLayoutAsInt(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return static_cast<const ConcreteAttr *>(impl)->getEffectiveLaneLayoutAsInt(tablegen_opaque_val);
}
template<typename ConcreteAttr>
SmallVector<int64_t> detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::getEffectiveLaneDataAsInt(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return static_cast<const ConcreteAttr *>(impl)->getEffectiveLaneDataAsInt(tablegen_opaque_val);
}
template<typename ConcreteAttr>
SmallVector<int64_t> detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::getEffectiveOrderAsInt(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return static_cast<const ConcreteAttr *>(impl)->getEffectiveOrderAsInt(tablegen_opaque_val);
}
template<typename ConcreteAttr>
xegpu::DistributeLayoutAttr detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::dropSgLayoutAndData(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return static_cast<const ConcreteAttr *>(impl)->dropSgLayoutAndData(tablegen_opaque_val);
}
template<typename ConcreteAttr>
xegpu::DistributeLayoutAttr detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::dropInstData(const Concept *impl, ::mlir::Attribute tablegen_opaque_val) {
return static_cast<const ConcreteAttr *>(impl)->dropInstData(tablegen_opaque_val);
}
template<typename ConcreteAttr>
xegpu::DistributeLayoutAttr detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::setUnitDimData(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, const SmallVector<int64_t> unitDims) {
return static_cast<const ConcreteAttr *>(impl)->setUnitDimData(tablegen_opaque_val, unitDims);
}
template<typename ConcreteAttr>
xegpu::DistributeLayoutAttr detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::setUnitDimLayout(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, const SmallVector<int64_t> unitDims) {
return static_cast<const ConcreteAttr *>(impl)->setUnitDimLayout(tablegen_opaque_val, unitDims);
}
template<typename ConcreteAttr>
FailureOr<SmallVector<Value>> detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::delinearizeId(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, OpBuilder & builder, Location loc, Value linearId) {
return static_cast<const ConcreteAttr *>(impl)->delinearizeId(tablegen_opaque_val, builder, loc, linearId);
}
template<typename ConcreteAttr>
xegpu::DistributeLayoutAttr detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::setDimData(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, int64_t dim, int64_t sgData, int64_t instData, int64_t laneData) {
return static_cast<const ConcreteAttr *>(impl)->setDimData(tablegen_opaque_val, dim, sgData, instData, laneData);
}
template<typename ConcreteAttr>
xegpu::DistributeLayoutAttr detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::dropDims(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, SmallVector<int64_t> dimGroup) {
return static_cast<const ConcreteAttr *>(impl)->dropDims(tablegen_opaque_val, dimGroup);
}
template<typename ConcreteAttr>
xegpu::DistributeLayoutAttr detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::collapseDims(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, SmallVector<int64_t> dimGroup) {
return static_cast<const ConcreteAttr *>(impl)->collapseDims(tablegen_opaque_val, dimGroup);
}
template<typename ConcreteAttr>
xegpu::DistributeLayoutAttr detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::expandDim(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, int64_t dim, ArrayRef<int64_t> targetShape) {
return static_cast<const ConcreteAttr *>(impl)->expandDim(tablegen_opaque_val, dim, targetShape);
}
template<typename ConcreteAttr>
xegpu::DistributeLayoutAttr detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::transposeDims(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, ArrayRef<int64_t> permutation) {
return static_cast<const ConcreteAttr *>(impl)->transposeDims(tablegen_opaque_val, permutation);
}
template<typename ConcreteAttr>
FailureOr<SmallVector<SmallVector<Value>>> detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::computeDistributedCoords(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, OpBuilder & builder, Location loc, Value linearId, ArrayRef<int64_t> shape) {
return static_cast<const ConcreteAttr *>(impl)->computeDistributedCoords(tablegen_opaque_val, builder, loc, linearId, shape);
}
template<typename ConcreteAttr>
SmallVector<SmallVector<int64_t>> detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::computeStaticDistributedCoords(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, int64_t linearId, ArrayRef<int64_t> shape) {
return static_cast<const ConcreteAttr *>(impl)->computeStaticDistributedCoords(tablegen_opaque_val, linearId, shape);
}
template<typename ConcreteAttr>
FailureOr<SmallVector<int64_t>> detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::computeDistributedShape(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, SmallVector<int64_t> shape) {
return static_cast<const ConcreteAttr *>(impl)->computeDistributedShape(tablegen_opaque_val, shape);
}
template<typename ConcreteAttr>
bool detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::isDistributable(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, SmallVector<int64_t> shape) {
return static_cast<const ConcreteAttr *>(impl)->isDistributable(tablegen_opaque_val, shape);
}
template<typename ConcreteAttr>
bool detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::isSliceOf(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, const xegpu::DistributeLayoutAttr& other) {
return static_cast<const ConcreteAttr *>(impl)->isSliceOf(tablegen_opaque_val, other);
}
template<typename ConcreteAttr>
bool detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::isTransposeOf(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, const xegpu::DistributeLayoutAttr& other, ArrayRef<int64_t> perm, xegpu::LayoutKind kind) {
return static_cast<const ConcreteAttr *>(impl)->isTransposeOf(tablegen_opaque_val, other, perm, kind);
}
template<typename ConcreteAttr>
bool detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::isCompatibleWith(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, const xegpu::DistributeLayoutAttr& other, SmallVector<int64_t> shape, xegpu::LayoutKind level) {
return static_cast<const ConcreteAttr *>(impl)->isCompatibleWith(tablegen_opaque_val, other, shape, level);
}
template<typename ConcreteAttr>
bool detail::DistributeLayoutAttrInterfaceTraits::FallbackModel<ConcreteAttr>::isEqualTo(const Concept *impl, ::mlir::Attribute tablegen_opaque_val, const xegpu::DistributeLayoutAttr& other) {
return static_cast<const ConcreteAttr *>(impl)->isEqualTo(tablegen_opaque_val, other);
}
} // namespace mlir::xegpu