[Mlir-commits] [mlir] 7218857 - [MLIR] Make MLIRRegisterAllPasses depend on mlir-headers (#196913)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon May 11 04:27:00 PDT 2026
Author: Fujun Han
Date: 2026-05-11T11:26:55Z
New Revision: 72188570e33648b173fc8d4262aea97776192c52
URL: https://github.com/llvm/llvm-project/commit/72188570e33648b173fc8d4262aea97776192c52
DIFF: https://github.com/llvm/llvm-project/commit/72188570e33648b173fc8d4262aea97776192c52.diff
LOG: [MLIR] Make MLIRRegisterAllPasses depend on mlir-headers (#196913)
RegisterAllPasses.cpp pulls in dialect Passes.h / generated Passes.h.inc
via TableGen targets that are tied to mlir-headers, but add_mlir_library
only adds mlir-generic-headers by default, so this TU can compile before
those generated headers are ready and registerAllPasses() can miss
passes (e.g. sporadic mlir-opt --help gaps). Add DEPENDS mlir-headers to
MLIRRegisterAllPasses in mlir/lib/CMakeLists.txt so it waits for those
outputs. Verified with ninja mlir-opt and mlir-opt --help | grep -E
'nvvm-attach-target|rocdl-attach-target' (or similar stable upstream
passes in your tree).
Signed-off-by: Fujun Han <fujun.han at iluvatar.com>
Co-authored-by: Cursor <cursoragent at cursor.com>
Added:
Modified:
mlir/lib/CMakeLists.txt
Removed:
################################################################################
diff --git a/mlir/lib/CMakeLists.txt b/mlir/lib/CMakeLists.txt
index d7a6e28d98586..576942b78f4a8 100644
--- a/mlir/lib/CMakeLists.txt
+++ b/mlir/lib/CMakeLists.txt
@@ -41,6 +41,12 @@ add_mlir_library(MLIRRegisterAllPasses
PARTIAL_SOURCES_INTENDED
+ # This TU includes dialect pass registration headers that depend on
+ # TableGen outputs (e.g. Passes.h.inc) wired into mlir-headers. Without this
+ # dependency it may compile before those headers are regenerated.
+ DEPENDS
+ mlir-headers
+
LINK_LIBS PUBLIC
${dialect_libs} # Some passes are part of the dialect libs
${conversion_libs}
More information about the Mlir-commits
mailing list