-
Notifications
You must be signed in to change notification settings - Fork 14.7k
[IR] Add new Range attribute using new ConstantRange Attribute type #83171
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
Changes from 3 commits
3c8ef54
41798a6
f262d44
81ad281
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -1634,6 +1634,22 @@ Currently, only the following parameter attributes are defined: | |||||||||
|
||||||||||
This attribute cannot be applied to return values. | ||||||||||
|
||||||||||
``range(<ty> <a>, <b>)`` | ||||||||||
This attribute expresses the possible range the parameter is in. The value of | ||||||||||
the parameter is in the specified range or is poison. | ||||||||||
The arguments passed to ``range`` has the following properties: | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
||||||||||
- The type must match the scalar type of the parameter. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there any downside in having the range just apply to all vector elems? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does apply to all vector elements:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh I see, for vector types you pull out the element type when creating the range. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
- The pair ``a,b`` represents the range ``[a,b)``. | ||||||||||
- Both ``a`` and ``b`` are constants. | ||||||||||
- The range is allowed to wrap. | ||||||||||
- The range should not represent the full or empty set. That is, ``a!=b``. | ||||||||||
|
||||||||||
This attribute may only be applied to parameters with integer or vector of | ||||||||||
integer types. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
||||||||||
For vector-typed parameters, the range is applied element-wise. | ||||||||||
|
||||||||||
.. _gc: | ||||||||||
|
||||||||||
Garbage Collector Strategy Names | ||||||||||
|
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.