[mlir][AttrTypeDefGen] Add support for custom parameter comparators
authorRiver Riddle <riddleriver@gmail.com>
Tue, 16 Mar 2021 23:30:34 +0000 (16:30 -0700)
committerRiver Riddle <riddleriver@gmail.com>
Tue, 16 Mar 2021 23:31:53 +0000 (16:31 -0700)
commit425e11eea1de022bd9ea099970b451f77b0a4fca
tree7833de779425febdf7b5375392c84ec1deb3f971
parent1f13963ec14a5c664633f78856e70de1d40258cd
[mlir][AttrTypeDefGen] Add support for custom parameter comparators

Some parameters to attributes and types rely on special comparison routines other than operator== to ensure equality. This revision adds support for those parameters by allowing them to specify a `comparator` code block that determines if `$_lhs` and `$_rhs` are equal. An example of one of these paramters is APFloat, which requires `bitwiseIsEqual` for bitwise comparison (which we want for attribute equality).

Differential Revision: https://reviews.llvm.org/D98473
mlir/docs/OpDefinitions.md
mlir/include/mlir/IR/OpBase.td
mlir/include/mlir/TableGen/AttrOrTypeDef.h
mlir/lib/TableGen/AttrOrTypeDef.cpp
mlir/test/mlir-tblgen/attrdefs.td
mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp