[PATCH] D75272: [MLIR] Refactor library initialization of JitRunner.

Stephen Neuendorffer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 27 10:09:42 PST 2020


stephenneuendorffer created this revision.
Herald added subscribers: llvm-commits, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, burmako, jpienaar, rriddle, mehdi_amini.
Herald added a project: LLVM.

Previously, lib/Support/JitRunner.cpp was essentially a complete application,
performing all library initialization, along with dealing with command line
arguments and actually running passes.  This differs significantly from
mlir-opt and required a dependency on InitAllDialects.h.  This dependency
is significant, since it requires a dependency on all of the resulting
libraries.

This patch refactors the code so that tools are responsible for library
initialization, including registering all dialects, prior to calling
JitRunnerMain.  This places the concern about what dialect to support
with the end application, enabling more extensibility at the cost of
a small amount of code duplication between tools.  It also fixes
BUILD_SHARED_LIBS=on.

Depends on D75222 <https://reviews.llvm.org/D75222>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75272

Files:
  mlir/lib/Support/JitRunner.cpp
  mlir/tools/mlir-cpu-runner/mlir-cpu-runner.cpp
  mlir/tools/mlir-cuda-runner/mlir-cuda-runner.cpp
  mlir/tools/mlir-vulkan-runner/mlir-vulkan-runner.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75272.247021.patch
Type: text/x-patch
Size: 4562 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200227/538df5f1/attachment.bin>


More information about the llvm-commits mailing list