[all-commits] [llvm/llvm-project] 42605e: [mlir][memref] Support truncating copied dims to n...

ioana ghiban via All-commits all-commits at lists.llvm.org
Wed Jul 15 05:49:50 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 42605e7b341ccbc6b2486e2ced82386f099c476a
      https://github.com/llvm/llvm-project/commit/42605e7b341ccbc6b2486e2ced82386f099c476a
  Author: ioana ghiban <ioana.ghiban at arm.com>
  Date:   2026-07-15 (Wed, 15 Jul 2026)

  Changed paths:
    M mlir/lib/Dialect/MemRef/Transforms/ElideReinterpretCast.cpp
    M mlir/test/Dialect/MemRef/elide-reinterpret-cast.mlir

  Log Message:
  -----------
  [mlir][memref] Support truncating copied dims to non-unit in reinterpret_cast elision (#209536)

Relax the `memref.copy`through `memref.reinterpret_cast` rewrite to
support same-dimension slices where strictly one non-unit source
dimension size is truncated to a smaller non-unit result dimension.

Previously, the rewrite only supported truncating to unit size:
```mlir
memref<1xMxNxf32>
  to memref<1xMx1xf32, strided<[M*N, N, 1], offset: OFF>>
```

This change relaxes constraints to also support:
```mlir
memref<1xMxNxf32>
  to memref<1xMxKxf32, strided<[M*N, N, 1], offset: OFF>>
```
where `K < N`.

The rewrite remains conservative:
* source must have identity layout, 
* result strides must match the source identity strides, 
* offset must be static for non-scalar results, and
* copied slice must be in bounds.


Assisted-by: Codex (refine PR description).



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list