[llvm] [IR] Introduce `llvm.allow.{runtime, ubsan}.check()` (PR #84850)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 20 08:44:05 PDT 2024


================
@@ -27696,6 +27696,125 @@ constant `true`. However it is always correct to replace
 it with any other `i1` value. Any pass can
 freely do it if it can benefit from non-default lowering.
 
+'``llvm.allow.ubsan.check``' Intrinsic
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Syntax:
+"""""""
+
+::
+
+      declare i1 @llvm.allow.ubsan.check(i8 immarg %kind)
+
+Overview:
+"""""""""
+
+This intrinsic returns ``true`` if and only if the compiler opted to enable the
+ubsan check in the current basic block.
+
+Rules to allow ubsan checks are not part of the intrinsic declaration, and
+controlled by compiler options.
+
+This intrinsic is ubsan specific version of ``@llvm.allow.runtime.check()``.
+
+Arguments:
+""""""""""
+
+An integer describing the kind of ubsan check guarded by the intrinsic.
+
+None.
----------------
nikic wrote:

Leftover.

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


More information about the llvm-commits mailing list