Add missing lowering to CFG in mlir-cpu-runner + related cleanup
authorMehdi Amini <aminim@google.com>
Sun, 1 Sep 2019 18:32:52 +0000 (11:32 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Sun, 1 Sep 2019 18:33:22 +0000 (11:33 -0700)
commit765d60fd4d4dc93f45bd74e4fd397e92feeb1714
tree0fb69f79ffdb91f51e44af46bdb8c2fcc340dbf5
parent2634273c59db653ab86bb99c5cdc9d87a01a8c5a
Add missing lowering to CFG in mlir-cpu-runner + related cleanup

- the list of passes run by mlir-cpu-runner included -lower-affine and
  -lower-to-llvm but was missing -lower-to-cfg (because -lower-affine at
  some point used to lower straight to CFG); add -lower-to-cfg in
  between. IR with affine ops can now be run by mlir-cpu-runner.

- update -lower-to-cfg to be consistent with other passes (create*Pass methods
  were changed to return unique ptrs, but -lower-to-cfg appears to have been
  missed).

- mlir-cpu-runner was unable to parse custom form of affine op's - fix
  link options

- drop unnecessary run options from test/mlir-cpu-runner/simple.mlir
  (none of the test cases had loops)

- -convert-to-llvmir was changed to -lower-to-llvm at some point, but the
  create pass method name wasn't updated (this pass converts/lowers to LLVM
  dialect as opposed to LLVM IR). Fix this.

(If we prefer "convert", the cmd-line options could be changed to
"-convert-to-llvm/cfg" then.)

Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Closes tensorflow/mlir#115

PiperOrigin-RevId: 266666909
mlir/bindings/python/pybind.cpp
mlir/include/mlir/Conversion/ControlFlowToCFG/ConvertControlFlowToCFG.h
mlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h
mlir/lib/Conversion/ControlFlowToCFG/ConvertControlFlowToCFG.cpp
mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
mlir/lib/Support/JitRunner.cpp
mlir/test/mlir-cpu-runner/simple.mlir
mlir/tools/mlir-cpu-runner/CMakeLists.txt