[llvm-branch-commits] [mlir] [mlir][cmake] Add missing MLIRTestDialect dependencies (PR #125834)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Feb 5 02:47:15 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir

Author: David Spickett (DavidSpickett)

<details>
<summary>Changes</summary>

This cherry picks
[mlir][cmake] Add missing MLIRTestDialect dependency (#<!-- -->125004) (72b73c9af694198096b2e0c47a1625e5b94c76a5) and
[mlir] Fix build race condition in Pass Manager tests (d906da5ead2764579395e5006c517f2ec9afd46f) to the 20.x release branch.

Both of these are addressing issues that started with https://github.com/llvm/llvm-project/pull/123910, which is already on the 20.x branch.

In each case the cherry-picked changes correct problems that would otherwise be a race condition in certain builds. Linaro noticed this on our flang dylib (shared library) build bot.

Failures look like:
In file included from /home/tcwg-buildbot/worker/flang-aarch64-dylib/llvm-project/mlir/test/lib/Pass/TestPassManager.cpp:10: /home/tcwg-buildbot/worker/flang-aarch64-dylib/llvm-project/mlir/test/lib/Pass/../Dialect/Test/TestOps.h:148:10: fatal error: 'TestOps.h.inc' file not found
  148 | #include "TestOps.h.inc"
      |          ^~~~~~~~~~~~~~~

We have tested these changes on the buildbot for the last 2 days and had no problems. Whereas before it was failing maybe 1 in 10 builds, enough that multiple people in the community noticed it.

Reported in https://github.com/llvm/llvm-project/issues/124485 and https://github.com/llvm/llvm-project/issues/124335.

---
Full diff: https://github.com/llvm/llvm-project/pull/125834.diff


2 Files Affected:

- (modified) mlir/test/lib/IR/CMakeLists.txt (+4) 
- (modified) mlir/test/lib/Pass/CMakeLists.txt (+3-1) 


``````````diff
diff --git a/mlir/test/lib/IR/CMakeLists.txt b/mlir/test/lib/IR/CMakeLists.txt
index e5416da70d50080..eeb9cf1e34fc8c0 100644
--- a/mlir/test/lib/IR/CMakeLists.txt
+++ b/mlir/test/lib/IR/CMakeLists.txt
@@ -27,7 +27,11 @@ add_mlir_library(MLIRTestIR
   TestVisitorsGeneric.cpp
 
   EXCLUDE_FROM_LIBMLIR
+
+  DEPENDS
+  MLIRTestDialect
   )
+
 mlir_target_link_libraries(MLIRTestIR PUBLIC
   MLIRPass
   MLIRBytecodeReader
diff --git a/mlir/test/lib/Pass/CMakeLists.txt b/mlir/test/lib/Pass/CMakeLists.txt
index 6698af86b8ae66d..c5d0bab8ec74946 100644
--- a/mlir/test/lib/Pass/CMakeLists.txt
+++ b/mlir/test/lib/Pass/CMakeLists.txt
@@ -10,12 +10,14 @@ add_mlir_library(MLIRTestPass
 
   ADDITIONAL_HEADER_DIRS
   ${MLIR_MAIN_INCLUDE_DIR}/mlir/Pass
+
+  LINK_LIBS PUBLIC
+  MLIRTestDialect
   )
 mlir_target_link_libraries(MLIRTestPass PUBLIC
   ${conversion_libs}
   MLIRIR
   MLIRPass
-  MLIRTestDialect
   )
 
 target_include_directories(MLIRTestPass

``````````

</details>


https://github.com/llvm/llvm-project/pull/125834


More information about the llvm-branch-commits mailing list