By registering shutdown callback with a mlir-cpu-runner dynamic libraries can prepare for the shutdown and do not depend on the global destructors execution order.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This seems to get in the direction of *more* "implicit global state" sharing instead of less.
What I'd rather see as a direction is to not dlopen libraries in Global mode, and dlsym specific mlir_runner_init/mlir_runner_destroy entry points in the libraries we load. These would be able to populate a list of symbols available to the JIT explicitly instead. This is something we already did for the ModelBuilder wrapper for example, see the extra_symbols here: https://github.com/google/iree/blob/main/experimental/ModelBuilder/ModelRunner.cpp#L57
Yeah, makes sense, also weak linking does not seem to work with MSVC, will try to the dlsym approach.
clang-tidy: warning: invalid case style for function '__mlir_cpu_runner_register_shutdown_callback' [readability-identifier-naming]
not useful