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.
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