[Mlir-commits] [mlir] [mlir][linalg] Add transpose support for reshape as consumer fusion (PR #130344)

Nirvedh Meshram llvmlistbot at llvm.org
Mon Mar 10 18:14:21 PDT 2025


================
@@ -816,17 +816,51 @@ validateDynamicDimExpansion(LinalgOp linalgOp,
 }
 
 // Create an expanded transpose op.
+// For bubbling a collapse : transpose(collapse_shape),
----------------
nirvedhmeshram wrote:

I fixed the bubbling/sinking naming error, about the permutation calculation. I think its more then needing the indexing maps a certain way. If you dont take the inverse of reassoc -> flatten -> inverse to get the expanded permutation in reshape as a consumer fusion, you just end up doing the wrong permutation on your input. Its because the reassociations are on the transposed layout but the expanded permutations we are looking for are on the untransposed layout. Am i missing something? Also if you have a concise way to describe the function below or would prefer to not have this comment/example as its confusing, happy to change/remove.

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


More information about the Mlir-commits mailing list