Skip to content

[nfc][mlir][scf]: Define scf.for lower/upper bounds can be also negative or zero #117534

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions mlir/include/mlir/Dialect/SCF/IR/SCFOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,10 @@ def ForOp : SCF_Op<"for",
operation defines an SSA value for its induction variable. It has one
region capturing the loop body. The induction variable is represented as an
argument of this region. This SSA value is a signless integer or index.
The step is a value of same type but required to be positive. The lower and
upper bounds specify a half-open range: the range includes the lower bound
but does not include the upper bound.
The step is a value of same type but required to be positive, the lower and
upper bounds can be also negative or zero. The lower and upper bounds specify
a half-open range: the iteration is executed iff the signed comparison of induction
variable value is less than the upper bound and bigger or equal to the lower bound.

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