[Mlir-commits] [mlir] [MLIR] Bubble up tensor.extract_slice through tensor.collapse_shape (PR #131982)

ofri frishman llvmlistbot at llvm.org
Mon Mar 24 03:21:36 PDT 2025


================
@@ -428,6 +429,190 @@ struct BubbleUpExpandShapeThroughExtractSlice
   }
 };
 
+/// Converts `tensor.collapse_shape(tensor.extract_slice)` to
+/// `tensor.extract_slice(tensor.collapse_shape)`.
+///
+/// For this transformation to be possible, the slice must be representable as a
+/// contiguous slice within each reassociation group of the src.
----------------
ofri-frishman wrote:

I updated this a bit using your phrasing and added a negative example at the end

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


More information about the Mlir-commits mailing list