[all-commits] [llvm/llvm-project] 77a26f: [mlir][memref] Keep memref.load attributes when el...

Hung-Kuan Tseng via All-commits all-commits at lists.llvm.org
Mon Sep 14 04:27:25 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 77a26fadb88bdc523ef82bcaec8c7e6217701a57
      https://github.com/llvm/llvm-project/commit/77a26fadb88bdc523ef82bcaec8c7e6217701a57
  Author: Hung-Kuan Tseng <tseng.tim096 at gmail.com>
  Date:   2026-09-14 (Mon, 14 Sep 2026)

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

  Log Message:
  -----------
  [mlir][memref] Keep memref.load attributes when eliding reinterpret_cast (#221314)

`RewriteLoadFromReinterpretCast` rebuilds the load on the source of the
`memref.reinterpret_cast` with the indices remapped to the non-unit
dimensions, but the rebuilt load carries none of `nontemporal`,
`alignment` or `invariant`:

```mlir
%rc = memref.reinterpret_cast %src to offset: [0], sizes: [1, 1, 8], strides: [8, 8, 1] : memref<1x8xf32> to memref<1x1x8xf32>
%0 = memref.load %rc[%c0, %c0, %i] alignment(16) nontemporal(true) invariant(true) : memref<1x1x8xf32>
// -memref-elide-reinterpret-cast today
%0 = memref.load %src[%c0, %i] : memref<1x8xf32>
```

The rewrite only changes how the same element is addressed, so the three
attributes describe the same access. This forwards them. Same shape of
fix as #221312 for `gpu-decompose-memrefs`.



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