[clang] [llvm] [SPIRV] Pack 64-bit vec2 typed buffers into 4x32-bit images (PR #208626)

Kaitlin Peng via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 15 15:48:57 PDT 2026


================
@@ -890,6 +890,14 @@ llvm::Type *CommonSPIRTargetCodeGenInfo::getSPIRVImageTypeFromHLSLResource(
          "The element type for a SPIR-V resource must be a scalar integer or "
          "floating point type.");
 
+  // SPIR-V has no 64-bit multi-component image format, so pack a 2-component
+  // 64-bit typed buffer into a 4-component 32-bit image. The backend
+  // reinterprets it with OpBitcast on load and store.
+  if (SampledType->isIntegerTy(64) && NumChannels == 2) {
----------------
kmpeng wrote:

I can add asserts

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


More information about the cfe-commits mailing list