[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

Cassandra Beckley via cfe-commits cfe-commits at lists.llvm.org
Tue May 6 16:38:02 PDT 2025


================
@@ -11763,6 +11804,22 @@ QualType ASTContext::mergeTypes(QualType LHS, QualType RHS, bool OfBlockPointer,
       return LHS;
     return {};
   }
+  case Type::HLSLInlineSpirv:
+    const HLSLInlineSpirvType *LHSTy = LHS->castAs<HLSLInlineSpirvType>();
+    const HLSLInlineSpirvType *RHSTy = RHS->castAs<HLSLInlineSpirvType>();
+
+    if (LHSTy->getOpcode() == RHSTy->getOpcode() &&
+        LHSTy->getSize() == RHSTy->getSize() &&
+        LHSTy->getAlignment() == RHSTy->getAlignment()) {
+      for (size_t I = 0; I < LHSTy->getOperands().size(); I++) {
+        if (LHSTy->getOperands()[I] != RHSTy->getOperands()[I]) {
+          return {};
+        }
+      }
----------------
cassiebeckley wrote:

Done.

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


More information about the cfe-commits mailing list