Skip to content

Commit 55fd283

Browse files
committed
Clarified that the input box cannot be absent.
I do not want to identify later whether the box might be absent and generate redundant present checks. To avoid redundant present checks I can add attribute like `present`/`maybe_absent`, but I think it should be easy to generate these ops under the present check upstream. So I would like to make them simple at least for now.
1 parent 1c8d7c5 commit 55fd283

File tree

1 file changed

+6
-0
lines changed
  • flang/include/flang/Optimizer/Dialect

1 file changed

+6
-0
lines changed

flang/include/flang/Optimizer/Dialect/FIROps.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3422,6 +3422,8 @@ def fir_IsContiguousBoxOp : fir_Op<"is_contiguous_box", [NoMemoryEffect]> {
34223422
Returns true iff the boxed entity is contiguous:
34233423
* in the leading dimension (if `innermost` attribute is set),
34243424
* in all dimensions (if `innermost` attribute is not set).
3425+
3426+
The input box cannot be absent.
34253427
}];
34263428
let arguments = (ins AnyBoxLike:$box, UnitAttr:$innermost);
34273429
let results = (outs I1);
@@ -3435,6 +3437,10 @@ def fir_IsContiguousBoxOp : fir_Op<"is_contiguous_box", [NoMemoryEffect]> {
34353437
def fir_BoxTotalElementsOp
34363438
: fir_SimpleOneResultOp<"box_total_elements", [NoMemoryEffect]> {
34373439
let summary = "Returns the boxed entity's total size in elements";
3440+
let description = [{
3441+
Returns the boxed entity's total size in elements.
3442+
The input box cannot be absent.
3443+
}];
34383444
let arguments = (ins AnyBoxLike:$box);
34393445
let results = (outs AnyIntegerLike);
34403446
let hasCanonicalizer = 1;

0 commit comments

Comments
 (0)