Repository navigation
Add missing dep on MLIRToLLVMIRTranslationRegistration to mlir-opt. - #75111
Conversation
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) ```
|
@llvm/pr-subscribers-mlir @llvm/pr-subscribers-mlir-core Author: Stella Laurenzo (stellaraccident) ChangesI 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 build on a stock build of MLIR on top of an existing LLVM. We were getting: 2 Files Affected:
diff --git a/mlir/tools/mlir-opt/CMakeLists.txt b/mlir/tools/mlir-opt/CMakeLists.txt
index 88a0562cb6e720..4d3d9173a93662 100644
--- a/mlir/tools/mlir-opt/CMakeLists.txt
+++ b/mlir/tools/mlir-opt/CMakeLists.txt
@@ -66,6 +66,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 3e3223b4850560..bd990bbfea84d8 100644
--- a/mlir/tools/mlir-opt/mlir-opt.cpp
+++ b/mlir/tools/mlir-opt/mlir-opt.cpp
@@ -274,6 +274,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
|
|
According to our CI logs, this appears to have broken somewhere between 13da9a5 (good) and 9fa3455 (bad). But as the dep was clearly missing, I considered it a better use of time to fix it than bisect and root cause. Scanning the patches, nothing jumped out, so I assume this was just something transitive that was accidentally working. |
|
I think the issue was introduced in 7fc792c ? |
I wonder how I missed this. I think I fell for the issue where my blame line was reporting patch timestamp, not commit time. I read past it since the view I had showed it as originating 4 months ago :/ (granted, I didn't try very hard to isolate it) |
…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) ```
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 build on a stock build of MLIR on top of an existing LLVM. We were getting: