-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[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
Conversation
10a850a
to
8e49c01
Compare
@llvm/pr-subscribers-mlir-scf Author: Aviad Cohen (AviadCo) ChangesPer the discussion here: #116748 (comment) , this commit properly declare that lower and upper bounds can be also negative or zero. Full diff: https://github.com/llvm/llvm-project/pull/117534.diff 1 Files Affected:
diff --git a/mlir/include/mlir/Dialect/SCF/IR/SCFOps.td b/mlir/include/mlir/Dialect/SCF/IR/SCFOps.td
index 361f8e0cf79ec6..64fa2df2431c71 100644
--- a/mlir/include/mlir/Dialect/SCF/IR/SCFOps.td
+++ b/mlir/include/mlir/Dialect/SCF/IR/SCFOps.td
@@ -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 range includes the lower bound but does not include
+ the upper bound.
The body region must contain exactly one block that terminates with
`scf.yield`. Calling ForOp::build will create such a region and insert
|
@llvm/pr-subscribers-mlir Author: Aviad Cohen (AviadCo) ChangesPer the discussion here: #116748 (comment) , this commit properly declare that lower and upper bounds can be also negative or zero. Full diff: https://github.com/llvm/llvm-project/pull/117534.diff 1 Files Affected:
diff --git a/mlir/include/mlir/Dialect/SCF/IR/SCFOps.td b/mlir/include/mlir/Dialect/SCF/IR/SCFOps.td
index 361f8e0cf79ec6..64fa2df2431c71 100644
--- a/mlir/include/mlir/Dialect/SCF/IR/SCFOps.td
+++ b/mlir/include/mlir/Dialect/SCF/IR/SCFOps.td
@@ -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 range includes the lower bound but does not include
+ the upper bound.
The body region must contain exactly one block that terminates with
`scf.yield`. Calling ForOp::build will create such a region and insert
|
…ive or zero Per the discussion here: llvm#116748 (comment) , this commit properly declare that lower and upper bounds can be also negative or zero.
8e49c01
to
b5b2499
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Per the discussion here: #116748 (comment) , this commit properly declare that lower and upper bounds can be also negative or zero.