[Mlir-commits] [mlir] [mlir][Tensor] Preserve correct rank expansions in InsertSlice canonicalizer (PR #217361)

Federico Bruzzone llvmlistbot at llvm.org
Tue Aug 25 00:47:07 PDT 2026


================
@@ -134,6 +138,16 @@ OpFoldResult getMixedSize(OpBuilder &builder, Location loc, Value value,
 SmallVector<OpFoldResult> getMixedSizes(OpBuilder &builder, Location loc,
                                         Value value);
 
+/// Infer a slice type with an exact rank-reduction pattern. The source tensor
+/// type provides the element type and encoding; its rank may differ from the
+/// number of sizes when dimensions are dropped.
+RankedTensorType inferSliceType(RankedTensorType sourceTensorType,
+                                ArrayRef<int64_t> staticSizes,
+                                const llvm::SmallBitVector &droppedDims);
+RankedTensorType inferSliceType(RankedTensorType sourceTensorType,
+                                ArrayRef<OpFoldResult> sizes,
+                                const llvm::SmallBitVector &droppedDims);
+
----------------
FedericoBruzzone wrote:

Not at all! Much clearer, thank you 🙏

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


More information about the Mlir-commits mailing list