Skip to content

Commit

Permalink
Registering the ROCDL dialect in init_mlir_dialects. (#18944)
Browse files Browse the repository at this point in the history
We're emitting those ops now (directly or indirectly) and in order to
parse IR that contains them (from e.g. resuming
--compile-to=executable-targets) we must have all dialects registered.
  • Loading branch information
benvanik authored Oct 30, 2024
1 parent d1dd3e3 commit 5fc340d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions compiler/src/iree/compiler/Tools/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ iree_compiler_cc_library(
"@llvm-project//mlir:MathDialect",
"@llvm-project//mlir:MemRefDialect",
"@llvm-project//mlir:QuantOps",
"@llvm-project//mlir:ROCDLDialect",
"@llvm-project//mlir:SCFDialect",
"@llvm-project//mlir:SCFToGPU",
"@llvm-project//mlir:SCFTransforms",
Expand Down
2 changes: 2 additions & 0 deletions compiler/src/iree/compiler/Tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

# Doesn't use bazel_to_cmake because of various special logic throughout.
# That there's various special logic throughout is _bad_. Don't replicate this.

# Enable compiler targets based on options.
set(IREE_COMPILER_TARGETS "")
Expand Down Expand Up @@ -95,6 +96,7 @@ iree_cc_library(
MLIRLinalgTransforms
MLIRMLProgramDialect
MLIRQuantDialect
MLIRROCDLDialect
MLIRSCFDialect
MLIRSCFToGPU
MLIRSCFTransforms
Expand Down
2 changes: 2 additions & 0 deletions compiler/src/iree/compiler/Tools/init_mlir_dialects.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "mlir/Dialect/GPU/IR/GPUDialect.h"
#include "mlir/Dialect/GPU/TransformOps/GPUTransformOps.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/Dialect/LLVMIR/ROCDLDialect.h"
#include "mlir/Dialect/LLVMIR/Transforms/InlinerInterfaceImpl.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"
#include "mlir/Dialect/Linalg/TransformOps/DialectExtension.h"
Expand Down Expand Up @@ -82,6 +83,7 @@ inline void registerMlirDialects(DialectRegistry &registry) {
pdl_interp::PDLInterpDialect,
scf::SCFDialect,
quant::QuantDialect,
ROCDL::ROCDLDialect,
spirv::SPIRVDialect,
arm_neon::ArmNeonDialect,
arm_sve::ArmSVEDialect,
Expand Down

0 comments on commit 5fc340d

Please sign in to comment.