mlir icon indicating copy to clipboard operation
mlir copied to clipboard

TableGen attribute name get methods on ops?

Open bondhugula opened this issue 6 years ago • 7 comments

In the custom print and parse methods of ops that have a tablegen description, in several places, the names of the attributes are either hardcoded or 'get' methods for the attributes are explicitly added to the tablegen description (for eg. getPredicateAttrName, getStepAttrName, getLowerBoundAttrName). Although the 'get' methods for the attributes themselves are automatically generated, auto generating 'get' methods for the attribute names will further reduce the amount of boilerplate code and prevent hardcoding it like here: https://github.com/tensorflow/mlir/blob/master/lib/Dialect/StandardOps/Ops.cpp#L1324

bondhugula avatar Sep 26 '19 03:09 bondhugula

It happens I've already prepared CLs for this. :) Going through reviews now.

antiagainst avatar Sep 26 '19 12:09 antiagainst

It happens I've already prepared CLs for this. :) Going through reviews now.

Thanks very much! :) I'll wait for this before I submit my pending stuff. Please feel free to close this once that's committed.

bondhugula avatar Sep 27 '19 01:09 bondhugula

It happens I've already prepared CLs for this. :) Going through reviews now.

@antiagainst Has this been committed? I didn't notice an update to the op def doc. Thanks.

bondhugula avatar Oct 08 '19 07:10 bondhugula

Oh, sorry, not yet. The CL depends on another CL that handles naming style of the generated getter methods. There are discussions on that. Let me see if I can rebase to unblock.

antiagainst avatar Oct 08 '19 14:10 antiagainst

Oh, sorry, not yet. The CL depends on another CL that handles naming style of the generated getter methods. There are discussions on that. Let me see if I can rebase to unblock.

@antiagainst Anything further on this? Thanks!

bondhugula avatar Oct 28 '19 16:10 bondhugula

Hey @bondhugula, sorry wasn't working on this because of other priorities. Will get back to this soon.

antiagainst avatar Oct 29 '19 21:10 antiagainst

Hey @bondhugula, sorry wasn't working on this because of other priorities. Will get back to this soon.

Okay, I couldn't wait for this :) I've submitted #225 When yours is committed, we can drop all the getAttr..Name() methods that were added to the td files.

bondhugula avatar Nov 07 '19 19:11 bondhugula