[mlir] Delete MemRefType::Builder::setMemorySpace(unsigned)
authorTres Popp <tpopp@google.com>
Tue, 23 Aug 2022 12:47:47 +0000 (14:47 +0200)
committerTres Popp <tpopp@google.com>
Mon, 29 Aug 2022 10:32:16 +0000 (12:32 +0200)
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

mlir/include/mlir/IR/BuiltinTypes.h
mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
mlir/lib/IR/BuiltinTypes.cpp

index 76b3ef8..171203e 100644 (file)
@@ -192,9 +192,6 @@ public:
     return *this;
   }
 
-  // [deprecated] `setMemorySpace(Attribute)` should be used instead.
-  Builder &setMemorySpace(unsigned newMemorySpace);
-
   operator MemRefType() {
     return MemRefType::get(shape, elementType, layout, memorySpace);
   }
index ef3efc8..2e89a3a 100644 (file)
@@ -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 {
index d122d9c..f361b43 100644 (file)
@@ -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());
 }