[Mlir-commits] [mlir] [mlir][memref] memref.view canonicalizations fixes (PR #173237)

Ivan Butygin llvmlistbot at llvm.org
Mon Dec 22 03:06:50 PST 2025


================
@@ -3675,7 +3675,8 @@ OpFoldResult ViewOp::fold(FoldAdaptor adaptor) {
   MemRefType sourceMemrefType = getSource().getType();
   MemRefType resultMemrefType = getResult().getType();
 
-  if (resultMemrefType == sourceMemrefType && resultMemrefType.hasStaticShape())
+  if (resultMemrefType == sourceMemrefType &&
+      resultMemrefType.hasStaticShape() && isZeroInteger(getByteShift()))
----------------
Hardcode84 wrote:

`fold_view_same_source_result_types`/`non_fold_view_non_zero_offset`

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


More information about the Mlir-commits mailing list