Skip to content

Commit b67670c

Browse files
authored
[mlir][core] Move InitAll*** implementation into static library. (#150805)
`InitAll***` functions are used by `opt`-style tools to init all MLIR dialects/passes/extensions. Currently they are implemeted as inline functions and include essentially the entire MLIR header tree. Each file which includes this header (~10 currently) takes 10+ sec and multiple GB of ram to compile (tested with clang-19), which limits amount of parallel compiler jobs which can be run. Also, flang just includes this file into one of its headers. Move the actual registration code to the static library, so it's compiled only once. Discourse thread https://discourse.llvm.org/t/rfc-moving-initall-implementation-into-static-library/87559
1 parent 39e7ca5 commit b67670c

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
# Dialect registration.
2-
get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
32
get_property(translation_libs GLOBAL PROPERTY MLIR_TRANSLATION_LIBS)
4-
get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
5-
get_property(extension_libs GLOBAL PROPERTY MLIR_EXTENSION_LIBS)
63
add_mlir_upstream_c_api_library(MLIRCAPIRegisterEverything
74
RegisterEverything.cpp
85

96
LINK_LIBS PUBLIC
10-
${dialect_libs}
117
${translation_libs}
12-
${conversion_libs}
13-
${extension_libs}
148

159
MLIRBuiltinToLLVMIRTranslation
1610
MLIRCAPIIR
17-
MLIRLLVMToLLVMIRTranslation
1811
MLIRCAPITransforms
12+
MLIRLLVMToLLVMIRTranslation
13+
MLIRRegisterAllDialects
14+
MLIRRegisterAllExtensions
15+
MLIRRegisterAllPasses
1916
)

0 commit comments

Comments
 (0)