[Mlir-commits] [mlir] [MLIR][AMDGPU] Add a wrapper for global LDS load intrinsics in AMDGPU (PR #133498)
Alan Li
llvmlistbot at llvm.org
Wed Apr 2 17:53:19 PDT 2025
================
@@ -112,21 +114,30 @@ LogicalResult FatRawBufferCastOp::verify() {
return success();
}
+static bool hasGlobalMemorySpace(Attribute memorySpace) {
+ if (!memorySpace)
+ return true;
+ else if (auto intMemorySpace = llvm::dyn_cast<IntegerAttr>(memorySpace))
+ return intMemorySpace.getInt() == 0 || intMemorySpace.getInt() == 1;
+ else if (auto gpuMemorySpace =
+ llvm::dyn_cast<gpu::AddressSpaceAttr>(memorySpace))
+ return gpuMemorySpace.getValue() == gpu::AddressSpace::Global;
+ return false;
+}
+
+static bool hasWorkgroupMemorySpace(Attribute memorySpace) {
+ if (auto intMemorySpace = llvm::dyn_cast<IntegerAttr>(memorySpace))
+ return intMemorySpace.getInt() == 3;
----------------
lialan wrote:
done.
https://github.com/llvm/llvm-project/pull/133498
More information about the Mlir-commits
mailing list