Remove tfl.reshape for the following two cases:
1. A tfl.reshape's input is from another tfl.reshape.
Then these two tfl.reshape ops can be merged.
2. A tfl.reshape's result type is the same as its input type.
This tfl.reshape op does nothing, which can be removed.
These transformations are put in a new source file, Canonicalizer.cpp,
because they are TFLite op to TFLite op transformations, and aiming
to making TFLite ops more canonicalized.
Also added a hasCanonicalizationPatterns marker in TableGen Op class
to indicate whether an op has custom getCanonicalizationPatterns().
PiperOrigin-RevId: 223806921
Derived attributes are attributes that are derived from other properties of the operation (e.g., the shape returned from the type). DerivedAttr is parameterized on the return type and function body.
PiperOrigin-RevId: 223180315
Separate the storage and return type more explicitly. This is in preparation for, among others, allowing supporting enum attributes where the return type is a enum class. NFC.
PiperOrigin-RevId: 219368487
This is done by changing Attribute to be a POD interface around an underlying pointer storage and adding in-class support for isa/dyn_cast/cast.
PiperOrigin-RevId: 218764173
Change how attributes can be added to an Op to make the syntax in the td file a bit cleaner. Also avoid unnecessarily emitting verify method (trivial return false one that's already in base) and use custom syntax in test.
PiperOrigin-RevId: 217330036
Create tblgen based tool to generate the C++ Op definitions. The modelling is
currently simple (ops, attributes, properties) with the printer/parser/verifier
the bodies of those functions and builders being very explicit.
PiperOrigin-RevId: 217150213