[Mlir-commits] [mlir] [mlir][xegpu] Add SIMT distribution support for GEMM transpose B case. (PR #155517)
Adam Siemieniuk
llvmlistbot at llvm.org
Mon Sep 15 06:12:53 PDT 2025
================
@@ -235,6 +235,61 @@ def DistributeLayoutAttr: AttrInterface<"DistributeLayoutAttr"> {
"FailureOr<SmallVector<SmallVector<Value>>>",
"getOffsets",
(ins "OpBuilder &": $builder, "Location":$loc, "Value":$linearId, "ArrayRef<int64_t>":$shape)>,
+ InterfaceMethod</*desc=*/[{Check if this layout can be achieved by applying a transpose
+ to some other layout according to given permutation of (0...n-1).}],
+ /*retTy=*/"bool",
+ /*methodName=*/"isTransposeOf",
+ /*args=*/(ins "const xegpu::DistributeLayoutAttr&": $other, "ArrayRef<int64_t>": $perm),
+ /*methodBody=*/[{
+ if (!other)
+ return false;
+ if ($_self.getRank() != other.getRank() || perm.size() != static_cast<size_t>($_self.getRank()))
+ return false;
+ // check if the permutation is valid
----------------
adam-smnk wrote:
nit: maybe you can use `isPermutationVector` from IndexingUtils?
https://github.com/llvm/llvm-project/pull/155517
More information about the Mlir-commits
mailing list