[clang] [llvm] [SPIR-V] Implement SPV_KHR_untyped_pointers extension (PR #201233)

Dmitry Sidorov via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 4 08:55:25 PDT 2026


================
@@ -404,6 +420,19 @@ class SPIRVGlobalRegistry : public SPIRVIRMapping {
   // argument. Otherwise returns 0.
   unsigned getNumScalarOrVectorTotalBitWidth(SPIRVTypeInst Type) const;
 
+  // True if a pointer to this element type must stay typed rather than become
+  // OpTypeUntypedPointerKHR (an opaque builtin type like an image or sampler).
+  bool isSpecialOpaqueElementType(SPIRVTypeInst ElemType) const;
+
+  // Byte size of a pointer value's IR-deduced element type, or 0 if unknown.
+  // Alloc size is what array indexing and copy strides use, so a 3-component
+  // vector counts as 4 components as OpenCL requires.
----------------
MrSidims wrote:

I have reworded it. Basically per OpenCL 3-element vectors require allocation like 4-element vectors (which makes probably makes sense even outside of OpenCL scope)

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


More information about the llvm-commits mailing list