llvm-project/mlir/lib
Smit Hinsu 2927297a1c Add derived type attributes for TensorFlow ops generated by TableGen
Motivation for this change is to remove redundant TF type attributes for
TensorFlow ops. For example, tf$T: "tfdtype$DT_FLOAT". Type attributes can be derived using the MLIR operand or result MLIR types, attribute names and their mapping. This will also allow constant folding of instructions generated within MLIR (and not imported from TensorFlow) without adding type attributes for the instruction.

Derived attributes are populated while exporting MLIR to TF GraphDef using
auto-generated populators. Populators are only available for the ops that are generated by the TableGen.

Also, fixed Operator::getNumArgs method to exclude derived attributes as they are not
part of the arguments.

TESTED with unit test

PiperOrigin-RevId: 232531561
2019-03-29 16:15:08 -07:00
..
AffineOps Remove InstWalker and move all instruction walking to the api facilities on Function/Block/Instruction. 2019-03-29 16:12:59 -07:00
Analysis Remove InstWalker and move all instruction walking to the api facilities on Function/Block/Instruction. 2019-03-29 16:12:59 -07:00
Dialect Remove remaining references to OperationInst in all directories except for lib/Transforms. 2019-03-29 16:10:38 -07:00
EDSC Implemented __eq__ and __ne__ in EDSC Python bindings 2019-03-29 16:13:34 -07:00
ExecutionEngine Fix use of llvm::Module::getOrInsertFunction after the upstream opaque pointer type changes. 2019-03-29 16:05:39 -07:00
IR Print parens around the return type of a function if it is also a function type 2019-03-29 16:14:50 -07:00
LLVMIR Remove remaining references to OperationInst in all directories except for lib/Transforms. 2019-03-29 16:10:38 -07:00
Parser Print parens around the return type of a function if it is also a function type 2019-03-29 16:14:50 -07:00
StandardOps Remove remaining references to OperationInst in all directories except for lib/Transforms. 2019-03-29 16:10:38 -07:00
SuperVectorOps Remove remaining references to OperationInst in all directories except for lib/Transforms. 2019-03-29 16:10:38 -07:00
Support Extract openInputFile() into Support/FileUtilities 2019-03-29 15:09:11 -07:00
TableGen Add derived type attributes for TensorFlow ops generated by TableGen 2019-03-29 16:15:08 -07:00
Target/LLVMIR Remove remaining references to OperationInst in all directories except for lib/Transforms. 2019-03-29 16:10:38 -07:00
Transforms Loop fusion improvements: 2019-03-29 16:13:50 -07:00
Translation Separate translators into "from MLIR" and "to MLIR". 2019-03-29 14:06:33 -07:00