[llvm] [IR] Add initial support for the byte type (PR #178666)

Ralf Jung via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 10 23:29:32 PST 2026


================
@@ -13029,6 +13090,15 @@ Example:
       %Z = bitcast <2 x i32> %V to i64; ; yields i64: %V (depends on endianness)
       %Z = bitcast <2 x i32*> %V to <2 x i64*> ; yields <2 x i64*>
 
+      ; considering %bi to hold an integer and %bp to hold a pointer,
+      %a = bitcast b64 %bi to i64       ; returns an integer, no-op cast
+      %b = bitcast b64 %bp to i64       ; reinterprets the pointer as an integer, returning its address without exposing provenance
+      %c = bitcast b64 %bp to ptr       ; returns a pointer, no-op cast
+      %d = bitcast b64 %bi to ptr       ; reinterprets the integer as a pointer, returning a pointer with no provenance
+
+      %e = bitcast <2 x b32> %v to i64  ; reinterprets the raw bytes as an integer
+      %f = bitcast <2 x b32> %v to ptr  ; reinterprets the raw bytes as a pointer
----------------
RalfJung wrote:

If all the bits in `%v` are from the same pointer and in their original order, then `%f` will have the same provenance as that pointer. Otherwise, it will have no provenance.

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


More information about the llvm-commits mailing list