[llvm] [SPIR-V] Add support for inline SPIR-V types (PR #125316)

Cassandra Beckley via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 14 09:49:26 PDT 2025


================
@@ -968,6 +968,29 @@ static TargetTypeInfo getTargetTypeInfo(const TargetExtType *Ty) {
   if (Name == "spirv.Image")
     return TargetTypeInfo(PointerType::get(C, 0), TargetExtType::CanBeGlobal,
                           TargetExtType::CanBeLocal);
+  if (Name == "spirv.Type") {
+    assert(Ty->getNumIntParameters() == 3 &&
+           "Wrong number of parameters for spirv.Type");
+
+    auto Size = Ty->getIntParameter(1);
+    auto Alignment = Ty->getIntParameter(2);
+
+    llvm::Type *LayoutType;
----------------
cassiebeckley wrote:

Good logic, done.

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


More information about the llvm-commits mailing list