[clang] [CIR] Wire AMDGPU into the call-convention lowering pass (PR #220197)

Steffen Larsen via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 14 05:55:09 PDT 2026


================
@@ -379,8 +379,11 @@ static mlir::Type abiTypeToCIR(const llvm::abi::Type *ty, MLIRContext *ctx) {
       .Case([&](const llvm::abi::FloatType *fltTy) {
         return cir::getFloatingPointType(*fltTy->getSemantics(), ctx);
       })
-      .Case([&](const llvm::abi::PointerType *) {
-        return cir::PointerType::get(cir::VoidType::get(ctx));
+      .Case([&](const llvm::abi::PointerType *ptrTy) {
+        mlir::ptr::MemorySpaceAttrInterface addrSpace;
+        if (unsigned as = ptrTy->getAddrSpace())
+          addrSpace = cir::TargetAddressSpaceAttr::get(ctx, as);
+        return cir::PointerType::get(cir::VoidType::get(ctx), addrSpace);
----------------
steffenlarsen wrote:

I believe we can consider the address space of the pointer valid always.

```suggestion
        return cir::PointerType::get(cir::VoidType::get(ctx), ptrTy->getAddrSpace());
```

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


More information about the cfe-commits mailing list