[Mlir-commits] [mlir] [mlir][tensor] Move extract_slice reshaping into two functions (PR #153675)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Aug 14 15:12:37 PDT 2025


================
@@ -142,6 +142,34 @@ FailureOr<Value> buildIndependentOp(OpBuilder &b, tensor::PadOp padOp,
 FailureOr<Value> buildIndependentOp(OpBuilder &b, tensor::EmptyOp emptyOp,
                                     ValueRange independencies);
 
+/// Computes the offsets, sizes, and strides needed to build a collapsed
+/// `sliceOp`. The dimensions to collapse are specified by `reassociation`.
+///
+/// This fails when the specified collapse cannot be represented by a valid
+/// ExtractSliceOp.
+LogicalResult
+getCollapsedExtractSliceInfo(tensor::ExtractSliceOp sliceOp,
----------------
MaheshRavishankar wrote:

Nit: I think the convention is to have the `OpBuilder` as the first argument,

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


More information about the Mlir-commits mailing list