[Mlir-commits] [mlir] da23ade - [mlir] Delete MemRefType::Builder::setMemorySpace(unsigned)
Tres Popp
llvmlistbot at llvm.org
Mon Aug 29 03:33:07 PDT 2022
Author: Tres Popp
Date: 2022-08-29T12:32:16+02:00
New Revision: da23adec20a3ac92955e9e734c3a26527c5b47e3
URL: https://github.com/llvm/llvm-project/commit/da23adec20a3ac92955e9e734c3a26527c5b47e3
DIFF: https://github.com/llvm/llvm-project/commit/da23adec20a3ac92955e9e734c3a26527c5b47e3.diff
LOG: [mlir] Delete MemRefType::Builder::setMemorySpace(unsigned)
This operation has been deprecated for a very long time now, so remove
it completely.
https://llvm.discourse.group/t/rfc-memref-memory-shape-as-attribute/2229
Differential Revision: https://reviews.llvm.org/D132466
Added:
Modified:
mlir/include/mlir/IR/BuiltinTypes.h
mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
mlir/lib/IR/BuiltinTypes.cpp
Removed:
################################################################################
diff --git a/mlir/include/mlir/IR/BuiltinTypes.h b/mlir/include/mlir/IR/BuiltinTypes.h
index 76b3ef8fa2d93..171203e9b26ff 100644
--- a/mlir/include/mlir/IR/BuiltinTypes.h
+++ b/mlir/include/mlir/IR/BuiltinTypes.h
@@ -192,9 +192,6 @@ class MemRefType::Builder {
return *this;
}
- // [deprecated] `setMemorySpace(Attribute)` should be used instead.
- Builder &setMemorySpace(unsigned newMemorySpace);
-
operator MemRefType() {
return MemRefType::get(shape, elementType, layout, memorySpace);
}
diff --git a/mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp b/mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
index ef3efc86d81ca..2e89a3a235085 100644
--- a/mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
+++ b/mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
@@ -183,7 +183,8 @@ struct LowerGpuOpsToNVVMOpsPass
if (type.getMemorySpaceAsInt() !=
gpu::GPUDialect::getPrivateAddressSpace())
return llvm::None;
- return converter.convertType(MemRefType::Builder(type).setMemorySpace(0));
+ return converter.convertType(MemRefType::Builder(type).setMemorySpace(
+ IntegerAttr::get(IntegerType::get(m.getContext(), 64), 0)));
});
// Lowering for MMAMatrixType.
converter.addConversion([&](gpu::MMAMatrixType type) -> Type {
diff --git a/mlir/lib/IR/BuiltinTypes.cpp b/mlir/lib/IR/BuiltinTypes.cpp
index d122d9c974f84..f361b4359a7c8 100644
--- a/mlir/lib/IR/BuiltinTypes.cpp
+++ b/mlir/lib/IR/BuiltinTypes.cpp
@@ -532,13 +532,6 @@ unsigned mlir::detail::getMemorySpaceAsInt(Attribute memorySpace) {
return static_cast<unsigned>(memorySpace.cast<IntegerAttr>().getInt());
}
-MemRefType::Builder &
-MemRefType::Builder::setMemorySpace(unsigned newMemorySpace) {
- memorySpace =
- wrapIntegerMemorySpace(newMemorySpace, elementType.getContext());
- return *this;
-}
-
unsigned MemRefType::getMemorySpaceAsInt() const {
return detail::getMemorySpaceAsInt(getMemorySpace());
}
More information about the Mlir-commits
mailing list