[all-commits] [llvm/llvm-project] 32c557: [MLIR] Split autogenerated pass declarations & C++...
Michele Scuttari via All-commits
all-commits at lists.llvm.org
Wed Aug 24 01:01:50 PDT 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 32c5578bcddf92a94947b390b4d2862bbb624622
https://github.com/llvm/llvm-project/commit/32c5578bcddf92a94947b390b4d2862bbb624622
Author: Michele Scuttari <michele.scuttari at outlook.com>
Date: 2022-08-24 (Wed, 24 Aug 2022)
Changed paths:
M mlir/docs/PassManagement.md
M mlir/include/mlir/Pass/PassBase.td
M mlir/lib/TableGen/Pass.cpp
M mlir/tools/mlir-tblgen/PassCAPIGen.cpp
M mlir/tools/mlir-tblgen/PassGen.cpp
M mlir/unittests/TableGen/CMakeLists.txt
M mlir/unittests/TableGen/PassGenTest.cpp
M mlir/unittests/TableGen/passes.td
Log Message:
-----------
[MLIR] Split autogenerated pass declarations & C++ controllable pass options
The pass tablegen backend has been reworked to remove the monolithic nature of the autogenerated declarations.
The pass public header can be generated with the -gen-pass-decls option. It contains options structs and registrations: the inclusion of options structs can be controlled individually for each pass by defining the GEN_PASS_DECL_PASSNAME macro; the declaration of the registrations have been kept together and can still be included by defining the GEN_PASS_REGISTRATION macro.
The private code used for the pass implementation (i.e. the pass base class and the constructors definitions, if missing from tablegen) can be generated with the -gen-pass-defs option. Similarly to the declarations file, the definitions of each pass can be enabled by defining the GEN_PASS_DEF_PASNAME variable.
While doing so, the pass base class has been enriched to also accept a the aformentioned struct of options and copy them to the actual pass options, thus allowing each pass to also be configurable within C++ and not only through command line.
Reviewed By: rriddle, mehdi_amini, Mogball, jpienaar
Differential Revision: https://reviews.llvm.org/D131839
More information about the All-commits
mailing list