From a30a4193bd58e7562e6b8a730e6f1c1962a71366 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Tue, 3 Dec 2024 10:22:21 -0500 Subject: [PATCH] Make `OpaqueMMALayout` local to `IREEGPUAttrs.cpp` (#19342) This implements a TODO from #19161, which is now unblocked by #19233. Signed-off-by: Benoit Jacob --- .../Codegen/Dialect/GPU/IR/IREEGPUAttrs.cpp | 15 ++++++++++----- .../Codegen/Dialect/GPU/IR/IREEGPUAttrs.h | 16 ---------------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUAttrs.cpp b/compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUAttrs.cpp index 803040d0451a..306e43ed5d27 100644 --- a/compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUAttrs.cpp +++ b/compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUAttrs.cpp @@ -276,6 +276,16 @@ MMASingleSubgroupLayout getSingleSubgroupLayout(MMAIntrinsic intrinsic, return {}; } +// Struct describing the shape of a MMA operation, but not the detailed layout. +struct OpaqueMmaLayout { + int64_t mSize = 0; + int64_t nSize = 0; + int64_t kSize = 0; + Type aType; + Type bType; + Type cType; +}; + template static OpaqueMmaLayout getOpaqueMMALayout(MLIRContext *context, MMAIntrinsicType intrinsic) { @@ -289,11 +299,6 @@ static OpaqueMmaLayout getOpaqueMMALayout(MLIRContext *context, return o; } -OpaqueMmaLayout getOpaqueMMALayout(MLIRContext *context, - IREE::GPU::MMAIntrinsic intrinsic) { - return getOpaqueMMALayout(context, intrinsic); -} - MMASingleSubgroupLayout getSingleSubgroupLayout(MmaInterfaceAttr mmaKind, MMAFragment fragment) { if (auto mmaAttr = dyn_cast(mmaKind)) { diff --git a/compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUAttrs.h b/compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUAttrs.h index cce4b682385e..c5b8d58cc153 100644 --- a/compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUAttrs.h +++ b/compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUAttrs.h @@ -68,22 +68,6 @@ MMASingleSubgroupLayout getSingleSubgroupLayout(VirtualMMAIntrinsic intrinsic, MMASingleSubgroupLayout getSingleSubgroupLayout(MmaInterfaceAttr mmaKind, MMAFragment fragment); -// Struct describing the shape of a MMA operation, but not the detailed layout. -// TODO(bjacob): the only user outside of IREEGPUAttrs.cpp is -// LLVMGPU/TransformExtensions, so maybe make that internal again if/when that -// goes away. -struct OpaqueMmaLayout { - int64_t mSize = 0; - int64_t nSize = 0; - int64_t kSize = 0; - Type aType; - Type bType; - Type cType; -}; - -OpaqueMmaLayout getOpaqueMMALayout(MLIRContext *context, - IREE::GPU::MMAIntrinsic intrinsic); - } // namespace mlir::iree_compiler::IREE::GPU // clang-format off