[Mlir-commits] [mlir] [mlir][memref] Define interfaces for ops that access memrefs at an index (PR #177013)
Alan Li
llvmlistbot at llvm.org
Tue Jan 20 20:58:26 PST 2026
================
@@ -0,0 +1,188 @@
+//===-- MemoryAccessOpInterfaces.td ---------------*- tablegen -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef MEMREF_MEMORY_ACCESS_OP_INTERFACES
+#define MEMREF_MEMORY_ACCESS_OP_INTERFACES
+
+include "mlir/IR/OpBase.td"
+
+def IndexedAccessOpInterface : OpInterface<"IndexedAccessOpInterface"> {
+ let description = [{
+ An interface for operations that operate on (by loading from or
+ storing to, atomically modifying, or otherwise) memory located at an
+ index within a memref whose semantics don't depend on the indexing scheme.
+
+ That is, a direct access op is one where, if `%b[%j0, %j1, ..., %jL]`
+ points to the same memory as `%a[%i0,%i1, ... %iK]`, it would be
+ trivial to replace `%a[%i0, ..., %iK]` with %b[%j0, ... %jL]`.
+
+ Operations may impose constaints on allowable reindexings.
----------------
lialan wrote:
```suggestion
Operations may impose constraints on allowable reindexings.
```
https://github.com/llvm/llvm-project/pull/177013
More information about the Mlir-commits
mailing list