Skip to content

Commit 21bb4fd

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

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

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

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

145145
def AssumeAlignmentOp : MemRef_Op<"assume_alignment", [
146146
DeclareOpInterfaceMethods<OpAsmOpInterface, ["getAsmResultNames"]>,
147-
Pure,
147+
Pure,
148148
ViewLikeOpInterface,
149149
SameOperandsAndResultType
150150
]> {
151151
let summary =
152-
"assertion that gives alignment information to the input memref";
152+
"assumption that gives alignment information to the input memref";
153153
let description = [{
154-
The `assume_alignment` operation takes a memref and an integer of alignment
154+
The `assume_alignment` operation takes a memref and an integer alignment
155155
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
156+
with the assumption that the underlying buffer is aligned to the given
157157
alignment.
158158

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-
159+
If the buffer isn't aligned to the given alignment, its result is poison.
164160
This operation doesn't affect the semantics of a program where the
165-
alignment assertion holds true. It is intended for optimization purposes,
161+
alignment assumption holds true. It is intended for optimization purposes,
166162
allowing the compiler to generate more efficient code based on the
167163
alignment assumption. The optimization is best-effort.
168164
}];

0 commit comments

Comments
 (0)