[Mlir-commits] [mlir] [mlir][sparse] fuse concat and extract_slice op if possible. (PR #89825)
Yinying Li
llvmlistbot at llvm.org
Tue Apr 23 15:07:55 PDT 2024
================
@@ -209,6 +209,86 @@ static void concatSizesFromInputs(OpBuilder &builder,
namespace {
+/// TODO: move it to tensor dialect instead.
+///
+/// Fold `tensor.concat` and `tensor.extract_slice`
+///
+/// %concat = tensor.concat dim(2) %t0, %t1
+/// : (tensor<1x64x1xf32>, tensor<1x64x1xf32>) -> tensor<1x64x2xf32>
+/// % extracted0 = tensor.extract_slice %concat[0, 0, 0][1, 64, 1][1, 1, 1]
----------------
yinying-lisa-li wrote:
nit: extract space between % and extracted?
https://github.com/llvm/llvm-project/pull/89825
More information about the Mlir-commits
mailing list