[mlir][RunnerUtils] Make symbols private + implement loading mechanism.
authorIngo Müller <ingomueller@google.com>
Mon, 19 Jun 2023 07:25:52 +0000 (07:25 +0000)
committerIngo Müller <ingomueller@google.com>
Tue, 20 Jun 2023 19:28:33 +0000 (19:28 +0000)
commitbba2b656110209a3d9863b92c060082479b06ab1
tree76f009e42efff0da5da7ecd0ca60db37ec524209
parentf9bce19e2e2be09768260d2a297d933f46bc3efd
[mlir][RunnerUtils] Make symbols private + implement loading mechanism.

There are two ways to make symbols from a shared library visible in the
execution engine: exporting the symbols with public visibility or
implementing a loading/unloading mechansim that registers the exported
symbols explicitly. The latter has only been available in the JIT runner
until recently, but https://reviews.llvm.org/D153029 makes it available
in any usage of the execution engine (including the Python bindings).

This patch makes the runner utils library use the latter mechanism
instead of the former, i.e., it makes all of its symbols private and
implements the init/destroy functions of the loading mechanism to
control explicitly which symbols it registers.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D153250
mlir/lib/ExecutionEngine/CMakeLists.txt
mlir/lib/ExecutionEngine/RunnerUtils.cpp