Skip to content

Commit

Permalink
Add missing dep on MLIRToLLVMIRTranslationRegistration to mlir-opt. (l…
Browse files Browse the repository at this point in the history
…lvm#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)
```
  • Loading branch information
stellaraccident authored Dec 12, 2023
1 parent 9567b33 commit 8eff570
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mlir/tools/mlir-opt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions mlir/tools/mlir-opt/mlir-opt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8eff570

Please sign in to comment.