[Mlir-commits] [mlir] [mlir][linalg][elementwise] Fold transpose into new elementwise (PR #130207)
Javed Absar
llvmlistbot at llvm.org
Sat Mar 8 14:09:34 PST 2025
================
@@ -4285,6 +4286,47 @@ Speculation::Speculatability ElementwiseOp::getSpeculatability() {
return getGenericSpeculatabilityImpl(cast<LinalgOp>(getOperation()));
}
+namespace {
+struct FoldTranspose : public OpRewritePattern<ElementwiseOp> {
----------------
javedabsar1 wrote:
> Indeed, we still have to discuss what we want as canonical representation for linalg.
For elementwise 'intra-op' the representation is already canonical by construction. What I mean by this is - there is no redundancy like 'unused args' (unlike linalg.generic). 'Inter-op' like the transpose example (single use) is waiting for @rengolin and @MaheshRavishankar and others consensus.
https://github.com/llvm/llvm-project/pull/130207
More information about the Mlir-commits
mailing list