[clang] [CIR] Upstream `AddressSpace` support for `PointerType` (PR #161028)

David Rivera via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 1 13:58:50 PDT 2025


================
@@ -601,6 +601,81 @@ def CIR_VTableAttr : CIR_Attr<"VTable", "vtable", [TypedAttrInterface]> {
   }];
 }
 
+//===----------------------------------------------------------------------===//
+// AddressSpaceAttr
+//===----------------------------------------------------------------------===//
+
+def CIR_AddressSpaceAttr :  CIR_EnumAttr<CIR_AddressSpace, "address_space"> {
+  let summary = "Attribute representing memory address spaces";
+  let description = [{
+    Represents different memory address spaces for pointer types.
+    Address spaces distinguish between different types of memory regions,
+    such as global, local, or constant memory.
+
+    The `value` parameter is an extensible enum, which encodes target address
----------------
RiverDave wrote:

Just for this PR as you specified, I've added and replaced the unified enum for the Target specific one. I'd like some feedback on that, as It's my first time messing with any MLIR's dialect definition :)

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


More information about the cfe-commits mailing list