[llvm] [CodeGen, CHERI] Add capability types to MVT. (PR #156616)

Jessica Clarke via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 3 10:24:54 PDT 2025


================
@@ -228,6 +228,9 @@ namespace llvm {
       return isSimple() ? V.is2048BitVector() : isExtended2048BitVector();
     }
 
+    /// Return true if this is a capability type.
+    bool isCapability() const { return isSimple() ? V.isCapability() : false; }
----------------
jrtc27 wrote:

isInteger means values of that type are integers. isCapability means values of that type are capabilities. This is capability in the capability-based security sense, which has a long history and is not some new term we've invented. See https://en.wikipedia.org/wiki/Capability-based_security for example:

> A capability (known in some systems as a key) is a communicable, unforgeable [token](https://en.wikipedia.org/wiki/Access_token) of authority

cheri_ptr64/cheri_ptr128 gets quite verbose and looks odd next to the iN counterparts. pAny for us is {iPTR, cPTR}, but you would be proposing having that mean {iPTR, cheri_ptrPTR}? That looks rather odd and silly.

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


More information about the llvm-commits mailing list