[clang] [SPIR-V] Permit implicit conversion to generic AS (PR #175109)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 9 07:22:23 PST 2026


================
@@ -317,6 +318,16 @@ class LLVM_LIBRARY_VISIBILITY BaseSPIRVTargetInfo : public BaseSPIRTargetInfo {
     return Feature == "spirv";
   }
 
+  virtual bool isAddressSpaceSupersetOf(LangAS A, LangAS B) const override {
+    // The geneirc space AS(4) is a superset of all the other address
+    // spaces used by the backend target.
+    return A == B || ((A == LangAS::Default ||
+                       (isTargetAddressSpace(A) &&
+                        toTargetAddressSpace(A) == /*Generic=*/4)) &&
----------------
jhuber6 wrote:

SPIR-V doesn't have any enums for this, their backend just hard-codes is everywhere AFAICT so fixing that is a little out of scope.

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


More information about the cfe-commits mailing list