[Mlir-commits] [mlir] [mlir][AMDGPU] Split the dialect declaration (NFC) (PR #222861)
Mehdi Amini
llvmlistbot at llvm.org
Thu Sep 10 23:56:38 PDT 2026
https://github.com/joker-eph created https://github.com/llvm/llvm-project/pull/222861
Introduce a self-contained dialect declaration so RegisterAllDialects does not need the generated AMDGPU operation umbrella.
Across five controlled rebuilds of the affected TU, median instructions fell from 71.757B to 70.331B (-1.987%) and median wall time fell from 11.01s to 10.77s (-2.180%).
Assisted-by: Codex
>From 96a51a0ac09e202d1aea1bb75f34392ebc051b6f Mon Sep 17 00:00:00 2001
From: Mehdi Amini <joker.eph at gmail.com>
Date: Thu, 10 Sep 2026 18:14:37 -0700
Subject: [PATCH] [mlir][AMDGPU] Split the dialect declaration (NFC)
Introduce a self-contained dialect declaration so RegisterAllDialects does not
need the generated AMDGPU operation umbrella.
Across five controlled rebuilds of the affected TU, median instructions fell
from 71.757B to 70.331B (-1.987%) and median wall time fell from 11.01s to
10.77s (-2.180%).
Assisted-by: Codex
---
.../mlir/Dialect/AMDGPU/IR/AMDGPUDialect.h | 3 +--
.../mlir/Dialect/AMDGPU/IR/AMDGPUDialectDecl.h | 16 ++++++++++++++++
mlir/lib/RegisterAllDialects.cpp | 2 +-
3 files changed, 18 insertions(+), 3 deletions(-)
create mode 100644 mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPUDialectDecl.h
diff --git a/mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPUDialect.h b/mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPUDialect.h
index 42d4a4e62f5e2..761cbfdd22166 100644
--- a/mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPUDialect.h
+++ b/mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPUDialect.h
@@ -15,6 +15,7 @@
#define MLIR_DIALECT_AMDGPU_IR_AMDGPUDIALECT_H_
#include "mlir/Bytecode/BytecodeOpInterface.h"
+#include "mlir/Dialect/AMDGPU/IR/AMDGPUDialectDecl.h"
#include "mlir/Dialect/LLVMIR/ROCDLDialect.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/Dialect.h"
@@ -23,8 +24,6 @@
#include "mlir/Interfaces/SideEffectInterfaces.h"
#include "mlir/Interfaces/ViewLikeInterface.h"
-#include "mlir/Dialect/AMDGPU/IR/AMDGPUDialect.h.inc"
-
#include "mlir/Dialect/AMDGPU/IR/AMDGPUEnums.h"
#include "mlir/Dialect/AMDGPU/IR/AMDGPUAttrs.h.inc"
diff --git a/mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPUDialectDecl.h b/mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPUDialectDecl.h
new file mode 100644
index 0000000000000..f676ecfad0b74
--- /dev/null
+++ b/mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPUDialectDecl.h
@@ -0,0 +1,16 @@
+//===- AMDGPUDialectDecl.h - AMDGPU dialect declaration --------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef MLIR_DIALECT_AMDGPU_IR_AMDGPUDIALECTDECL_H
+#define MLIR_DIALECT_AMDGPU_IR_AMDGPUDIALECTDECL_H
+
+#include "mlir/IR/Dialect.h"
+
+#include "mlir/Dialect/AMDGPU/IR/AMDGPUDialect.h.inc"
+
+#endif // MLIR_DIALECT_AMDGPU_IR_AMDGPUDIALECTDECL_H
diff --git a/mlir/lib/RegisterAllDialects.cpp b/mlir/lib/RegisterAllDialects.cpp
index ebc48a4bfc836..80395a6166734 100644
--- a/mlir/lib/RegisterAllDialects.cpp
+++ b/mlir/lib/RegisterAllDialects.cpp
@@ -13,7 +13,7 @@
#include "mlir/InitAllDialects.h"
-#include "mlir/Dialect/AMDGPU/IR/AMDGPUDialect.h"
+#include "mlir/Dialect/AMDGPU/IR/AMDGPUDialectDecl.h"
#include "mlir/Dialect/AMDGPU/Transforms/MemoryAccessOpInterfacesImpl.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Affine/IR/ValueBoundsOpInterfaceImpl.h"
More information about the Mlir-commits
mailing list