[PATCH] D72514: [mlir][ods] Support dialect specific content emission via hooks

Lei Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 10 08:30:13 PST 2020


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

Thus far we can only generate the same set of methods even for
operations in different dialects. This is problematic for dialects that
want to generate additional operation class methods programmatically,
e.g., a special builder method or attribute getter method. Apparently
we cannot update the OpDefinitionsGen backend every time when such
a need arises. So this CL introduces a hook into the OpDefinitionsGen
backend to allow dialects to emit additional methods and traits to
operation classes.

To make this happen, existing helper classes for C++ code emission
are exposed via a new header file. Code related to it involves NFC.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D72514

Files:
  mlir/include/mlir/TableGen/ODSDialectHook.h
  mlir/include/mlir/TableGen/OpClass.h
  mlir/include/mlir/TableGen/Operator.h
  mlir/lib/TableGen/CMakeLists.txt
  mlir/lib/TableGen/OpClass.cpp
  mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72514.237341.patch
Type: text/x-patch
Size: 31323 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200110/cb799425/attachment.bin>


More information about the llvm-commits mailing list