[llvm] [LangRef] Clarify that selects can have !unpredictable (PR #162753)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 9 17:01:23 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-ir
Author: Tim Creech (tcreech-intel)
<details>
<summary>Changes</summary>
Originally `!unpredictable` could only appear on branches and switches, but now it can also appear on selects. This change updates the LangRef accordingly.
---
Full diff: https://github.com/llvm/llvm-project/pull/162753.diff
1 Files Affected:
- (modified) llvm/docs/LangRef.rst (+6-6)
``````````diff
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index 8b6c25c58d61e..738743d04e6bb 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -7517,12 +7517,12 @@ sections that the user does not want removed after linking.
'``unpredictable``' Metadata
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``unpredictable`` metadata may be attached to any branch or switch
-instruction. It can be used to express the unpredictability of control
-flow. Similar to the ``llvm.expect`` intrinsic, it may be used to alter
-optimizations related to compare and branch instructions. The metadata
-is treated as a boolean value; if it exists, it signals that the branch
-or switch that it is attached to is completely unpredictable.
+``unpredictable`` metadata may be attached to any branch, select, or switch
+instruction. It can be used to express the unpredictability of control flow.
+Similar to the ``llvm.expect`` intrinsic, it may be used to alter optimizations
+related to compare and branch instructions. The metadata is treated as a
+boolean value; if it exists, it signals that the branch, select, or switch that
+it is attached to is completely unpredictable.
.. _md_dereferenceable:
``````````
</details>
https://github.com/llvm/llvm-project/pull/162753
More information about the llvm-commits
mailing list