[llvm] Add llvm.cond.loop intrinsic. (PR #177686)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 23 23:26:00 PST 2026


================
@@ -32234,3 +32201,49 @@ intrinsics that this intrinsic is lowered into. The intent is that the
 deactivation symbol represents a field identifier.
 
 This intrinsic is used to implement structure protection.
+
+'``llvm.cond.loop``' Intrinsic
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Syntax:
+"""""""
+
+::
+
+      declare void @llvm.cond.loop(i1 pred)
+
+Overview:
+"""""""""
+
+The '``llvm.cond.loop``' intrinsic spins in an infinite loop if the
+given predicate ``pred`` is true, otherwise it does nothing.
+
+Arguments:
+""""""""""
+
+``pred`` is the predicate.
+
+Semantics:
+""""""""""
+
+This intrinsic is semantically equivalent to a conditional branch
+conditioned on ``pred`` to a basic block consisting only of an
+unconditional branch to itself. Unlike such a branch, it is guaranteed
+to use specific instructions. This allows an interrupt handler or other
----------------
arsenm wrote:

```suggestion
Unlike such a branch, it is guaranteed to use specific instructions. 
```

I do not think this should be documented as a general requirement 

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


More information about the llvm-commits mailing list