[PATCH] D80420: [mlir] Expand operand adapter to take attributes

Jacques Pienaar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 21 18:57:37 PDT 2020


jpienaar created this revision.
jpienaar added a reviewer: mehdi_amini.
Herald added subscribers: llvm-commits, jurahul, Kayjukh, frgossen, grosul1, Joonsoo, stephenneuendorffer, liufengdb, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, rriddle.
Herald added a reviewer: antiagainst.
Herald added a project: LLVM.

- Enables using with more variadic sized operands;
- Generate convenience accessors for attributes;
  - The accessor are named the same as their name in ODS and returns attribute type (not convenience type) and no derived attributes.

This would also allow verifying argument constraints before the op is even
created (and dedupe some checking between shapes and created ops). This does
not change the name of adaptor nor does it require it except for ops with
variadic operands to keep this change smaller. The named attributes created
such could potentially also replace the xAttr variants being generated.

I considered creating separate adapter for attributes but decided against that
given operands queries require attributes in general (and definitely for
verification of operands and attributes).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80420

Files:
  mlir/include/mlir/TableGen/OpClass.h
  mlir/lib/TableGen/OpClass.cpp
  mlir/test/mlir-tblgen/op-decl.td
  mlir/test/mlir-tblgen/op-operand.td
  mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80420.265657.patch
Type: text/x-patch
Size: 11999 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200522/1cbdedd2/attachment.bin>


More information about the llvm-commits mailing list