[llvm] [LangRef] Clarify that selects can have !unpredictable (PR #162753)

Tim Creech via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 9 17:00:50 PDT 2025


https://github.com/tcreech-intel created https://github.com/llvm/llvm-project/pull/162753

Originally `!unpredictable` could only appear on branches and switches, but now it can also appear on selects. This change updates the LangRef accordingly.

>From 34e97fb73eba2ed85b09ba592e21464627145c60 Mon Sep 17 00:00:00 2001
From: Tim Creech <timothy.m.creech at intel.com>
Date: Thu, 9 Oct 2025 19:44:27 -0400
Subject: [PATCH] [LangRef] Clarify that selects can have !unpredictable

Originally `!unpredictable` could only appear on branches and switches,
but now it can also appear on selects. This change updates the LangRef
accordingly.
---
 llvm/docs/LangRef.rst | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

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:
 



More information about the llvm-commits mailing list