Skip to content

Commit 8e49c01

Browse files
author
Aviad Cohen
committed
[nfc[[mlir][scf]: Define scf.for lower/upper bounds can be also negative or zero
Per the discussion here: #116748 (comment) , this commit properly declare that lower and upper bounds can be also negative or zero.
1 parent c537c75 commit 8e49c01

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mlir/include/mlir/Dialect/SCF/IR/SCFOps.td

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,10 @@ def ForOp : SCF_Op<"for",
153153
operation defines an SSA value for its induction variable. It has one
154154
region capturing the loop body. The induction variable is represented as an
155155
argument of this region. This SSA value is a signless integer or index.
156-
The step is a value of same type but required to be positive. The lower and
157-
upper bounds specify a half-open range: the range includes the lower bound
158-
but does not include the upper bound.
156+
The step is a value of same type but required to be positive, the lower and
157+
upper bounds can be also negative or zero. The lower and upper bounds specify
158+
a half-open range: the range includes the lower bound but does not include
159+
the upper bound.
159160

160161
The body region must contain exactly one block that terminates with
161162
`scf.yield`. Calling ForOp::build will create such a region and insert

0 commit comments

Comments
 (0)