llvm-project/mlir
Alex Zinenko 0a95aac7c7 Allow Builder to create function-type constants
A recent change made ConstantOp::build accept a NumericAttr or assert that a
generic Attribute is in fact a NumericAttr.  The rationale behind the change
was that NumericAttrs have a type that can be used as the result type of the
constant operation.  FunctionAttr also has a type, and it is valid to construct
function-typed constants as exercised by the parser.mlir test.  Relax
ConstantOp::build back to take a generic Attribute.  In the overload that only
takes an attribute, assert that the Attribute is either a NumericAttr or a
FunctionAttr, because it is necessary to extract the type.  In the overload
that takes both type type and the attribute, delegate the attribute type
checking to ConstantOp::verify to prevent non-Builder-based Op construction
mechanisms from creating invalid IR.
PiperOrigin-RevId: 234798569
2019-03-29 16:34:41 -07:00
..
bindings/python EDSC: introduce min/max only usable inside for upper/lower bounds of a loop 2019-03-29 16:34:11 -07:00
g3doc Update pass documentation + improve/fix some comments 2019-03-29 16:32:11 -07:00
include Allow Builder to create function-type constants 2019-03-29 16:34:41 -07:00
lib Allow Builder to create function-type constants 2019-03-29 16:34:41 -07:00
test EDSC: emit composed affine maps again 2019-03-29 16:34:26 -07:00
tools NFC: Refactor the files related to passes. 2019-03-29 16:32:56 -07:00
utils Automated rollback of changelist 232728977. 2019-03-29 16:21:38 -07:00
.clang-format [mlir] add .clang-format 2019-03-29 12:41:43 -07:00
LICENSE.TXT Continue sketching out basic infrastructure, including an input and output 2019-03-29 12:23:51 -07:00