[Mlir-commits] [mlir] 8eff570 - Add missing dep on MLIRToLLVMIRTranslationRegistration to mlir-opt. (#75111)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Dec 12 14:10:10 PST 2023
Author: Stella Laurenzo
Date: 2023-12-12T14:10:06-08:00
New Revision: 8eff5704829ba5edd28754fd9ec7665b34fde22a
URL: https://github.com/llvm/llvm-project/commit/8eff5704829ba5edd28754fd9ec7665b34fde22a
DIFF: https://github.com/llvm/llvm-project/commit/8eff5704829ba5edd28754fd9ec7665b34fde22a.diff
LOG: Add missing dep on MLIRToLLVMIRTranslationRegistration to mlir-opt. (#75111)
I was not able to fully triage why this just started failing on one of
our bots as it seems that the use was added 4 months ago. I would assume
that it was accidentally coming in transitively in some way as the dep
was definitely missing.
For context, this started failing in [our
byo_llvm](https://github.com/openxla/iree/blob/main/build_tools/llvm/byo_llvm.sh)
build on a stock build of MLIR on top of an existing LLVM. We were
getting:
```
ld.lld: error: undefined symbol: mlir::registerSPIRVDialectTranslation(mlir::DialectRegistry&) >>> referenced by mlir-opt.cpp
>>> tools/mlir-opt/CMakeFiles/mlir-opt.dir/mlir-opt.cpp.o:(main)
```
Added:
Modified:
mlir/tools/mlir-opt/CMakeLists.txt
mlir/tools/mlir-opt/mlir-opt.cpp
Removed:
################################################################################
diff --git a/mlir/tools/mlir-opt/CMakeLists.txt b/mlir/tools/mlir-opt/CMakeLists.txt
index bc8eed1821552..b6ada66d32188 100644
--- a/mlir/tools/mlir-opt/CMakeLists.txt
+++ b/mlir/tools/mlir-opt/CMakeLists.txt
@@ -67,6 +67,10 @@ set(LIBS
MLIRTransformUtils
MLIRSupport
MLIRIR
+
+ # TODO: Remove when registerAllGPUToLLVMIRTranslations is no longer
+ # registered directly in mlir-opt.cpp.
+ MLIRToLLVMIRTranslationRegistration
)
# Exclude from libMLIR.so because this has static options intended for
diff --git a/mlir/tools/mlir-opt/mlir-opt.cpp b/mlir/tools/mlir-opt/mlir-opt.cpp
index c7cf1e55a556f..b7c69eabbcd8b 100644
--- a/mlir/tools/mlir-opt/mlir-opt.cpp
+++ b/mlir/tools/mlir-opt/mlir-opt.cpp
@@ -276,6 +276,10 @@ int main(int argc, char **argv) {
DialectRegistry registry;
registerAllDialects(registry);
registerAllExtensions(registry);
+
+ // TODO: Remove this and the corresponding MLIRToLLVMIRTranslationRegistration
+ // cmake dependency when a safe dialect interface registration mechanism is
+ // implemented, see D157703 (and corresponding note on the declaration).
registerAllGPUToLLVMIRTranslations(registry);
#ifdef MLIR_INCLUDE_TESTS
More information about the Mlir-commits
mailing list