[mlir][PDLL] Add support for generating PDL patterns from PDLL at build time
authorRiver Riddle <riddleriver@gmail.com>
Wed, 20 Apr 2022 05:46:34 +0000 (22:46 -0700)
committerRiver Riddle <riddleriver@gmail.com>
Wed, 27 Apr 2022 01:33:16 +0000 (18:33 -0700)
commit597fde54a8d6f19b5fe6563c0ba9f8b6b9158c28
treee318a84d1fa25d103edad8f2712f8924be49af00
parentb3fc0fa84a09540d8fc7214899021acbf2fd6ff8
[mlir][PDLL] Add support for generating PDL patterns from PDLL at build time

This essentially sets up mlir-pdll to function in a similar manner to mlir-tblgen. Aside
from the boilerplate of configuring CMake and setting up a basic initial test, two new
options are added to mlir-pdll to mirror options provided by tblgen:

* -d
 This option generates a dependency file (i.e. a set of build time dependencies) while
 processing the input file.

* --write-if-changed
 This option only writes to the output file if the data would have changed, which for
 the build system prevents unnecesarry rebuilds if the file was touched but not actually
 changed.

Differential Revision: https://reviews.llvm.org/D124075
17 files changed:
mlir/CMakeLists.txt
mlir/cmake/modules/AddMLIR.cmake
mlir/cmake/modules/CMakeLists.txt
mlir/cmake/modules/MLIRConfig.cmake.in
mlir/test/lib/CMakeLists.txt
mlir/test/lib/Tools/CMakeLists.txt [new file with mode: 0644]
mlir/test/lib/Tools/PDLL/CMakeLists.txt [new file with mode: 0644]
mlir/test/lib/Tools/PDLL/TestPDLL.cpp [new file with mode: 0644]
mlir/test/lib/Tools/PDLL/TestPDLL.pdll [new file with mode: 0644]
mlir/test/lib/Tools/PDLL/lit.local.cfg [new file with mode: 0644]
mlir/test/mlir-pdll/Integration/test-pdll.mlir [new file with mode: 0644]
mlir/test/mlir-pdll/Parser/dependency-file.pdll [new file with mode: 0644]
mlir/tools/CMakeLists.txt
mlir/tools/mlir-opt/CMakeLists.txt
mlir/tools/mlir-opt/mlir-opt.cpp
mlir/tools/mlir-pdll/CMakeLists.txt
mlir/tools/mlir-pdll/mlir-pdll.cpp