Skip to content

Commit c4ad9b4

Browse files
author
Shay Kleiman
committed
Added trait NoMemoryEffect to assume_alignment
Assume_alignment has no trait which specifies how it interacts with memory, this causes an issue in OwnershipBasedBufferDeallocation, which require all operations which operate on buffers to have explicit traits defining how the operation interacts with memory. To prevent this error, I changed assume_alignment to include the trait NoMemoryEffect. This is valid because assume_alignment is an assertion for optimization purposes only; it does not allocate, free, read, or write memory, nor does it change program semantics or memory state.
1 parent acd6294 commit c4ad9b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class AllocLikeOp<string mnemonic,
142142
// AssumeAlignmentOp
143143
//===----------------------------------------------------------------------===//
144144

145-
def AssumeAlignmentOp : MemRef_Op<"assume_alignment"> {
145+
def AssumeAlignmentOp : MemRef_Op<"assume_alignment", [NoMemoryEffect]> {
146146
let summary =
147147
"assertion that gives alignment information to the input memref";
148148
let description = [{

0 commit comments

Comments
 (0)