[Mlir-commits] [mlir] [mlir][MemRef] Changed AssumeAlignment into a Pure ViewLikeOp (PR #139521)
Matthias Springer
llvmlistbot at llvm.org
Thu May 15 15:45:06 PDT 2025
================
@@ -142,22 +142,41 @@ class AllocLikeOp<string mnemonic,
// AssumeAlignmentOp
//===----------------------------------------------------------------------===//
-def AssumeAlignmentOp : MemRef_Op<"assume_alignment"> {
+def AssumeAlignmentOp : MemRef_Op<"assume_alignment", [
+ DeclareOpInterfaceMethods<OpAsmOpInterface, ["getAsmResultNames"]>,
+ Pure,
+ ViewLikeOpInterface,
+ SameOperandsAndResultType
+ ]> {
let summary =
"assertion that gives alignment information to the input memref";
let description = [{
- The `assume_alignment` operation takes a memref and an integer of alignment
- value, and internally annotates the buffer with the given alignment. If
- the buffer isn't aligned to the given alignment, the behavior is undefined.
+ The `assume_alignment` operation takes a memref and an integer of alignment
+ value. It returns a new SSA value of the same memref type, but associated
+ with the assertion that the underlying buffer is aligned to the given
----------------
matthias-springer wrote:
`with the assumption`
I wouldn't call it "assertion" because it does not assert
https://github.com/llvm/llvm-project/pull/139521
More information about the Mlir-commits
mailing list