[Mlir-commits] [mlir] [MLIR][Linalg] pack, unpack to take memref inputs (PR #129036)

Han-Chung Wang llvmlistbot at llvm.org
Wed Mar 26 15:21:20 PDT 2025


================
@@ -76,6 +76,13 @@ class Linalg_RelayoutOp<string mnemonic, list<Trait> traits = []> :
     /// have been tiled. Also, the order of the output dimensions is consistent
     /// with `inner_dims_pos` rather than the packed tensor.
     SmallVector<int64_t> getTiledOuterDims();
+
+         void $cppClass::getEffects(
+         SmallVectorImpl<SideEffects::EffectInstance<MemoryEffects::Effect>>
+             &effects) {
+       getGenericEffectsImpl(effects, cast<LinalgOp>(getOperation()));
+     }
----------------
hanhanW wrote:

I think it is better to put the implementation to LinalgOps.cpp. And I believe that this is not working for relayout ops because they are not LinalgOp. I think you need to implement it separately and you can follow what we've done in IREE.

https://github.com/llvm/llvm-project/blob/6075275e68bd2362095af76b1acb49c2ac9610a4/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td#L225-L229

https://github.com/llvm/llvm-project/pull/129036


More information about the Mlir-commits mailing list