[Mlir-commits] [mlir] [MLIR] Fix canonicalization of extract_slice(unpack) (PR #181840)

Mikhail Romanov llvmlistbot at llvm.org
Thu Feb 19 12:14:01 PST 2026


================
@@ -6407,6 +6409,15 @@ bool UnPackOp::canFoldSliceOp(tensor::ExtractSliceOp sliceOp) {
     if (paddingSize >= tileSize)
       return false;
   }
+  for (int64_t pos = 0, e = outerShapeWithoutTranspose.size(); pos < e; ++pos) {
+    if (areOuterDimsTiled[pos])
+      continue;
+    int64_t dim = outerShapeWithoutTranspose[pos];
+    if (ShapedType::isDynamic(dim))
+      return false;
+    if (dim != unpackedTypeAfterFold.getDimSize(pos))
+      return false;
----------------
Mmi257ia wrote:

Thanks, added

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


More information about the Mlir-commits mailing list