[llvm-branch-commits] [clang] [lld] [llvm] [mlir] [RFC][AMDGPU] Add BARRIER address space (PR #195613)

Fabian Mora via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Jun 15 04:45:44 PDT 2026


================
@@ -683,15 +683,15 @@ struct GPUInitializeNamedBarrierOpLowering final
 
     auto targetTy = LLVM::LLVMTargetExtType::get(
         rewriter.getContext(), "amdgcn.named.barrier", {}, {0});
-    auto ptrTy = LLVM::LLVMPointerType::get(rewriter.getContext(), 3);
+    auto ptrTy = LLVM::LLVMPointerType::get(rewriter.getContext(), 15);
 
     // Build the global detached so SymbolTable::insert can both place it and
     // rename it as needed without creating a transient name conflict in IR.
     OpBuilder detachedBuilder(rewriter.getContext());
     auto globalOp = LLVM::GlobalOp::create(
         detachedBuilder, loc, targetTy, /*isConstant=*/false,
         LLVM::Linkage::Internal, "__named_barrier", /*value=*/Attribute(),
-        /*alignment=*/0, /*addrSpace=*/3);
+        /*alignment=*/0, /*addrSpace=*/15);
----------------
fabianmcg wrote:

```suggestion
        /*alignment=*/0, /*addrSpace=*/ROCDL::ROCDLDialect::kBarrierAddressSpace);
```

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


More information about the llvm-branch-commits mailing list