[all-commits] [llvm/llvm-project] fb0b03: [mlir-cpu-runner] Add support for `-mattr` and `-m...

Andrzej WarzyƄski via All-commits all-commits at lists.llvm.org
Fri Mar 31 00:34:44 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fb0b035e35ba1203912c7a756697d30c271fedb3
      https://github.com/llvm/llvm-project/commit/fb0b035e35ba1203912c7a756697d30c271fedb3
  Author: Andrzej Warzynski <andrzej.warzynski at gmail.com>
  Date:   2023-03-31 (Fri, 31 Mar 2023)

  Changed paths:
    M mlir/examples/toy/Ch6/toyc.cpp
    M mlir/examples/toy/Ch7/toyc.cpp
    M mlir/include/mlir/ExecutionEngine/ExecutionEngine.h
    M mlir/lib/ExecutionEngine/ExecutionEngine.cpp
    M mlir/lib/ExecutionEngine/JitRunner.cpp
    M mlir/test/Integration/Dialect/SparseTensor/CPU/concatenate_dim_1.mlir
    A mlir/test/mlir-cpu-runner/verify-flags.mlir

  Log Message:
  -----------
  [mlir-cpu-runner] Add support for `-mattr` and `-march` flags

This patch adds support for `-mattr` and `-march` in mlir-cpu-runner.
With this change, one should be able to consistently use mlir-cpu-runner
for MLIR's integration tests (instead of e.g. resorting to lli when some
additional flags are needed). This is demonstrated in
concatenate_dim_1.mlir.

In order to support the new flags, this patch makes sure that
MLIR's ExecutionEngine/JITRunner (that mlir-cpu-runner is built on top of):
  * takes into account the new command line flags when creating
    TargetMachine,
  * avoids recreating TargetMachine if one is already available,
  * creates LLVM's DataLayout based on the previously configured
    TargetMachine.
This is necessary in order to make sure that the command line
configuration is propagated correctly to the backend code generator.

A few additional updates are made in order to facilitate this change,
including support for debug dumps from JITRunner.

Differential Revision: https://reviews.llvm.org/D146917




More information about the All-commits mailing list