This is an archive of the discontinued LLVM Phabricator instance.

[mlir] mlir-cpu-runner: Register shutdown callbacks with the runner
AbandonedPublic

Authored by ezhulenev on Jan 7 2021, 11:56 AM.

Details

Reviewers
mehdi_amini
Summary

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.

Diff Detail

Event Timeline

ezhulenev created this revision.Jan 7 2021, 11:56 AM
ezhulenev requested review of this revision.Jan 7 2021, 11:56 AM
ezhulenev edited the summary of this revision. (Show Details)Jan 7 2021, 11:57 AM
ezhulenev added a reviewer: mehdi_amini.
ezhulenev updated this revision to Diff 315195.Jan 7 2021, 11:58 AM

Remove extra space

ezhulenev updated this revision to Diff 315204.Jan 7 2021, 12:27 PM

Fix CMakeLists

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

ezhulenev abandoned this revision.Jan 7 2021, 12:53 PM

Yeah, makes sense, also weak linking does not seem to work with MSVC, will try to the dlsym approach.