[Mlir-commits] [mlir] [mlir][memref] Introduce `memref.distinct_objects` op (PR #156913)
Matthias Springer
llvmlistbot at llvm.org
Tue Sep 23 05:37:04 PDT 2025
================
@@ -168,14 +168,49 @@ def AssumeAlignmentOp : MemRef_Op<"assume_alignment", [
let assemblyFormat = "$memref `,` $alignment attr-dict `:` type($memref)";
let extraClassDeclaration = [{
MemRefType getType() { return ::llvm::cast<MemRefType>(getResult().getType()); }
-
+
Value getViewSource() { return getMemref(); }
}];
let hasVerifier = 1;
let hasFolder = 1;
}
+//===----------------------------------------------------------------------===//
+// DistinctObjectsOp
+//===----------------------------------------------------------------------===//
+
+def DistinctObjectsOp : MemRef_Op<"distinct_objects", [
+ Pure,
+ DeclareOpInterfaceMethods<InferTypeOpInterface>
+ // ViewLikeOpInterface TODO: ViewLikeOpInterface only supports a single argument
+ ]> {
+ let summary = "assumption that acesses to specific memrefs will never alias";
+ let description = [{
+ The `distinct_objects` operation takes a list of memrefs and returns a list of
+ memrefs of the same types, with the additional assumption that accesses to
+ these memrefs will never alias with each other. This means that loads and
+ stores to different memrefs in the list can be safely reordered.
+
+ If the memrefs do alias, the behavior is undefined. This operation doesn't
+ affect the semantics of a program where the non-aliasing assumption holds
----------------
matthias-springer wrote:
I find this sentence confusing. Can this be rephrased as: `This operation doesn't affect the semantics of the program.` ?
https://github.com/llvm/llvm-project/pull/156913
More information about the Mlir-commits
mailing list