llvm-project/mlir/lib/IR
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
..
AffineExpr.cpp Extend/improve getSliceBounds() / complete TODO + update unionBoundingBox 2019-03-29 16:33:11 -07:00
AffineExprDetail.h [MLIR] Sketch AffineExpr value type 2019-03-29 13:25:42 -07:00
AffineMap.cpp Make IndexType a standard type instead of a builtin. This also cleans up some unnecessary factory methods on the Type class. 2019-03-29 16:25:38 -07:00
AffineMapDetail.h Introduce Fourier-Motzkin variable elimination + other cleanup/support 2019-03-29 13:38:24 -07:00
AffineStructures.cpp Extend/improve getSliceBounds() / complete TODO + update unionBoundingBox 2019-03-29 16:33:11 -07:00
AsmPrinter.cpp Make IndexType a standard type instead of a builtin. This also cleans up some unnecessary factory methods on the Type class. 2019-03-29 16:25:38 -07:00
AttributeDetail.h Add dialect-specific decoding for opaque constants. 2019-03-29 16:24:38 -07:00
AttributeListStorage.h Delicately re-layer Operation, Statement, and OperationStmt, reworking 2019-03-29 14:41:05 -07:00
Attributes.cpp Add dialect-specific decoding for opaque constants. 2019-03-29 16:24:38 -07:00
Block.cpp Remove the restriction that only registered terminator operations may terminate a block and have block operands. This allows for any operation to hold block operands. It also introduces the notion that unregistered operations may terminate a block. As such, the 'isTerminator' api on Instruction has been split into 'isKnownTerminator' and 'isKnownNonTerminator'. 2019-03-29 16:22:23 -07:00
Builders.cpp Make IndexType a standard type instead of a builtin. This also cleans up some unnecessary factory methods on the Type class. 2019-03-29 16:25:38 -07:00
BuiltinOps.cpp Allow Builder to create function-type constants 2019-03-29 16:34:41 -07:00
Dialect.cpp Add dialect-specific decoding for opaque constants. 2019-03-29 16:24:38 -07:00
Function.cpp Remove InstWalker and move all instruction walking to the api facilities on Function/Block/Instruction. 2019-03-29 16:12:59 -07:00
Instruction.cpp Remove the restriction that only registered terminator operations may terminate a block and have block operands. This allows for any operation to hold block operands. It also introduces the notion that unregistered operations may terminate a block. As such, the 'isTerminator' api on Instruction has been split into 'isKnownTerminator' and 'isKnownNonTerminator'. 2019-03-29 16:22:23 -07:00
IntegerSet.cpp Introduce Fourier-Motzkin variable elimination + other cleanup/support 2019-03-29 13:38:24 -07:00
IntegerSetDetail.h Introduce Fourier-Motzkin variable elimination + other cleanup/support 2019-03-29 13:38:24 -07:00
Location.cpp Support NameLoc and CallSiteLoc for mlir::Location 2019-03-29 14:37:34 -07:00
LocationDetail.h Support NameLoc and CallSiteLoc for mlir::Location 2019-03-29 14:37:34 -07:00
MLIRContext.cpp Add dialect-specific decoding for opaque constants. 2019-03-29 16:24:38 -07:00
Module.cpp Implement initial support for function attributes, including parser, printer, 2019-03-29 13:02:44 -07:00
Operation.cpp Remove the restriction that only registered terminator operations may terminate a block and have block operands. This allows for any operation to hold block operands. It also introduces the notion that unregistered operations may terminate a block. As such, the 'isTerminator' api on Instruction has been split into 'isKnownTerminator' and 'isKnownNonTerminator'. 2019-03-29 16:22:23 -07:00
PatternMatch.cpp Remove remaining references to OperationInst in all directories except for lib/Transforms. 2019-03-29 16:10:38 -07:00
StandardTypes.cpp Make IndexType a standard type instead of a builtin. This also cleans up some unnecessary factory methods on the Type class. 2019-03-29 16:25:38 -07:00
TypeDetail.h Migrate VectorOrTensorType/MemRefType shape api to use int64_t instead of int. 2019-03-29 15:33:20 -07:00
Types.cpp Make IndexType a standard type instead of a builtin. This also cleans up some unnecessary factory methods on the Type class. 2019-03-29 16:25:38 -07:00
Value.cpp Begin the process of fully removing OperationInst. This patch cleans up references to OperationInst in the /include, /AffineOps, and lib/Analysis. 2019-03-29 16:09:36 -07:00