llvm-project/mlir/lib/IR
River Riddle 8abc06f3d5 Implement initial support for dialect specific types.
Dialect specific types are registered similarly to operations, i.e. registerType<...> within the dialect. Unlike operations, there is no notion of a "verbose" type, that is *all* types must be registered to a dialect. Casting support(isa/dyn_cast/etc.) is implemented by reserving a range of type kinds in the top level Type class as opposed to string comparison like operations.

To support derived types a few hooks need to be implemented:

In the concrete type class:
    - static char typeID;
      * A unique identifier for the type used during registration.

In the Dialect:
    - typeParseHook and typePrintHook must be implemented to provide parser support.

The syntax for dialect extended types is as follows:
 dialect-type:  '!' dialect-namespace '<' '"' type-specific-data '"' '>'

The 'type-specific-data' is information used to identify different types within the dialect, e.g:
 - !tf<"variant"> // Tensor Flow Variant Type
 - !tf<"string">  // Tensor Flow String Type

TensorFlow/TensorFlowControl types are now implemented as dialect specific types as a proof
 of concept.

PiperOrigin-RevId: 227580052
2019-03-29 14:53:07 -07:00
..
AffineExpr.cpp [MLIR] Add AffineMap composition and use it in Materialization 2019-03-29 14:20:22 -07:00
AffineExprDetail.h [MLIR] Sketch AffineExpr value type 2019-03-29 13:25:42 -07:00
AffineMap.cpp Add Type to int/float attributes. 2019-03-29 13:59:23 -07:00
AffineMapDetail.h Introduce Fourier-Motzkin variable elimination + other cleanup/support 2019-03-29 13:38:24 -07:00
AsmPrinter.cpp Implement initial support for dialect specific types. 2019-03-29 14:53:07 -07:00
AttributeDetail.h Type system: replace Type::getBitWidth with getIntOrFloatBitWidth 2019-03-29 14:30:43 -07:00
AttributeListStorage.h Delicately re-layer Operation, Statement, and OperationStmt, reworking 2019-03-29 14:41:05 -07:00
Attributes.cpp add a method to get FloatAttr value as double 2019-03-29 14:41:34 -07:00
Block.cpp Introduce PostDominanceInfo, fix properlyDominates() for Instructions 2019-03-29 14:48:44 -07:00
Builders.cpp Implement initial support for dialect specific types. 2019-03-29 14:53:07 -07:00
BuiltinOps.cpp Implement initial support for dialect specific types. 2019-03-29 14:53:07 -07:00
Dialect.cpp Rename OperationPrefix to Namespace in Dialect. This is important as dialects will soon be able to define more than just operations. 2019-03-29 14:51:22 -07:00
Function.cpp Eliminate extfunc/cfgfunc/mlfunc as a concept, and just use 'func' instead. 2019-03-29 14:51:37 -07:00
Instruction.cpp Rename OperationPrefix to Namespace in Dialect. This is important as dialects will soon be able to define more than just operations. 2019-03-29 14:51:22 -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 Implement initial support for dialect specific types. 2019-03-29 14:53:07 -07:00
Module.cpp Implement initial support for function attributes, including parser, printer, 2019-03-29 13:02:44 -07:00
Operation.cpp Merge the verifier logic for all functions into a unified framework, this 2019-03-29 14:45:43 -07:00
PatternMatch.cpp Standardize naming of statements -> instructions, revisting the code base to be 2019-03-29 14:44:30 -07:00
TypeDetail.h Unify type uniquing and construction. 2019-03-29 14:34:46 -07:00
Types.cpp Implement initial support for dialect specific types. 2019-03-29 14:53:07 -07:00
Value.cpp Standardize naming of statements -> instructions, revisting the code base to be 2019-03-29 14:44:30 -07:00