[PATCH] D119414: [LangRef] Allow non-power-of-two assume operand bundle
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 23 07:53:35 PDT 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG5737ce259bf5: [LangRef] Allow non-power-of-two assume operand bundle (authored by nikic).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119414/new/
https://reviews.llvm.org/D119414
Files:
llvm/docs/LangRef.rst
Index: llvm/docs/LangRef.rst
===================================================================
--- llvm/docs/LangRef.rst
+++ llvm/docs/LangRef.rst
@@ -2428,9 +2428,6 @@
If there are no arguments the attribute is a property of the call location.
-If the represented attribute expects a constant argument, the argument provided
-to the operand bundle should be a constant as well.
-
For example:
.. code-block:: llvm
@@ -2450,6 +2447,20 @@
Just like for the argument of :ref:`llvm.assume <int_assume>`, if any of the
provided guarantees are violated at runtime the behavior is undefined.
+While attributes expect constant arguments, assume operand bundles may be
+provided a dynamic value, for example:
+
+.. code-block:: llvm
+
+ call void @llvm.assume(i1 true) ["align"(i32* %val, i32 %align)]
+
+If the operand bundle value violates any requirements on the attribute value,
+the behavior is undefined, unless one of the following exceptions applies:
+
+* ``"assume"`` operand bundles may specify a non-power-of-two alignment
+ (including a zero alignment). If this is the case, then the pointer value
+ must be a null pointer, otherwise the behavior is undefined.
+
Even if the assumed property can be encoded as a boolean value, like
``nonnull``, using operand bundles to express the property can still have
benefits:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119414.417619.patch
Type: text/x-patch
Size: 1345 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220323/f0a1ca88/attachment.bin>
More information about the llvm-commits
mailing list