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

Conversation

AviadCo
Copy link
Contributor

@AviadCo AviadCo commented Nov 25, 2024

Per the discussion here: #116748 (comment) , this commit properly declare that lower and upper bounds can be also negative or zero.

@llvmbot
Copy link
Member

llvmbot commented Nov 25, 2024

@llvm/pr-subscribers-mlir-scf

Author: Aviad Cohen (AviadCo)

Changes

Per 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:

  • (modified) mlir/include/mlir/Dialect/SCF/IR/SCFOps.td (+4-3)
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

@llvmbot
Copy link
Member

llvmbot commented Nov 25, 2024

@llvm/pr-subscribers-mlir

Author: Aviad Cohen (AviadCo)

Changes

Per 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:

  • (modified) mlir/include/mlir/Dialect/SCF/IR/SCFOps.td (+4-3)
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

@AviadCo AviadCo changed the title [mlir][scf]: Define scf.for lower/upper bounds can be also negative or zero (nfc) [nfc][mlir][scf]: Define scf.for lower/upper bounds can be also negative or zero Nov 25, 2024
…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.
Copy link
Contributor

@ThomasRaoux ThomasRaoux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@AviadCo AviadCo merged commit bca1177 into llvm:main Dec 14, 2024
8 checks passed
@AviadCo AviadCo deleted the scf/make-for-clear branch December 14, 2024 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants