Skip to content

Commit 8eff570

Browse files
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) ```
1 parent 9567b33 commit 8eff570

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

mlir/tools/mlir-opt/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ set(LIBS
6767
MLIRTransformUtils
6868
MLIRSupport
6969
MLIRIR
70+
71+
# TODO: Remove when registerAllGPUToLLVMIRTranslations is no longer
72+
# registered directly in mlir-opt.cpp.
73+
MLIRToLLVMIRTranslationRegistration
7074
)
7175

7276
# Exclude from libMLIR.so because this has static options intended for

mlir/tools/mlir-opt/mlir-opt.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,10 @@ int main(int argc, char **argv) {
276276
DialectRegistry registry;
277277
registerAllDialects(registry);
278278
registerAllExtensions(registry);
279+
280+
// TODO: Remove this and the corresponding MLIRToLLVMIRTranslationRegistration
281+
// cmake dependency when a safe dialect interface registration mechanism is
282+
// implemented, see D157703 (and corresponding note on the declaration).
279283
registerAllGPUToLLVMIRTranslations(registry);
280284

281285
#ifdef MLIR_INCLUDE_TESTS

0 commit comments

Comments
 (0)