Skip to content

Commit 637364b

Browse files
author
Shay Kleiman
committed
Modified assume_alignment description
Changed assertion to assumption and improved description of poison
1 parent 1177df6 commit 637364b

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

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

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -144,25 +144,20 @@ class AllocLikeOp<string mnemonic,
144144

145145
def AssumeAlignmentOp : MemRef_Op<"assume_alignment", [
146146
DeclareOpInterfaceMethods<OpAsmOpInterface, ["getAsmResultNames"]>,
147-
Pure,
148-
ViewLikeOpInterface,
147+
Pure,
149148
SameOperandsAndResultType
150149
]> {
151150
let summary =
152-
"assertion that gives alignment information to the input memref";
151+
"assumption that gives alignment information to the input memref";
153152
let description = [{
154-
The `assume_alignment` operation takes a memref and an integer of alignment
153+
The `assume_alignment` operation takes a memref and an integer alignment
155154
value. It returns a new SSA value of the same memref type, but associated
156-
with the assertion that the underlying buffer is aligned to the given
155+
with the assumption that the underlying buffer is aligned to the given
157156
alignment.
158157

159-
If the buffer isn't aligned to the given alignment, this operation
160-
itself does not cause undefined behavior. However, subsequent operations
161-
that consume the resulting memref and rely on this asserted alignment for
162-
correctness will produce a poison value if the assertion is false.
163-
158+
If the buffer isn't aligned to the given alignment, its result is poison.
164159
This operation doesn't affect the semantics of a program where the
165-
alignment assertion holds true. It is intended for optimization purposes,
160+
alignment assumption holds true. It is intended for optimization purposes,
166161
allowing the compiler to generate more efficient code based on the
167162
alignment assumption. The optimization is best-effort.
168163
}];

0 commit comments

Comments
 (0)