[llvm] [IR] Add new Range attribute using new ConstantRange Attribute type (PR #83171)

Andreas Jonson via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 27 14:28:14 PST 2024


================
@@ -1634,6 +1634,24 @@ 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. If the 
+    value of the parameter is not in the specified range, a poison value is 
+    returned instead.
----------------
andjo403 wrote:

it was copied from the range metadata but I agree it sounds strange, how about:
The value of the parameter is in the specified range or is poison.

https://github.com/llvm/llvm-project/pull/83171


More information about the llvm-commits mailing list