llvm-project/mlir/lib
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
..
AffineOps Add a generic pattern matcher for matching constant values produced by an operation with zero operands and a single result. 2019-03-29 16:31:56 -07:00
Analysis NFC: Refactor the files related to passes. 2019-03-29 16:32:56 -07:00
Dialect Add binary broadcastable builder. 2019-03-29 16:23:38 -07:00
EDSC EDSC: emit composed affine maps again 2019-03-29 16:34:26 -07:00
ExecutionEngine NFC: Refactor the files related to passes. 2019-03-29 16:32:56 -07:00
IR Allow Builder to create function-type constants 2019-03-29 16:34:41 -07:00
LLVMIR NFC: Refactor the files related to passes. 2019-03-29 16:32:56 -07:00
Parser Add langref descriptions for the attribute values supported in MLIR. 2019-03-29 16:26:08 -07:00
Pass NFC: Refactor the files related to passes. 2019-03-29 16:32:56 -07:00
StandardOps Update pass documentation + improve/fix some comments 2019-03-29 16:32:11 -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 [TableGen] Support using Variadic<Type> in results 2019-03-29 16:31:11 -07:00
Target/LLVMIR LLVM dialect conversion and target: support indirect calls 2019-03-29 16:28:56 -07:00
Transforms Extend/improve getSliceBounds() / complete TODO + update unionBoundingBox 2019-03-29 16:33:11 -07:00
Translation Separate translators into "from MLIR" and "to MLIR". 2019-03-29 14:06:33 -07:00