llvm-project/mlir/test/lib
River Riddle 0d7ff220ed [mlir] Refactor TypeConverter to add conversions without inheritance
Summary:
This revision refactors the TypeConverter class to not use inheritance to add type conversions. It instead moves to a registration based system, where conversion callbacks are added to the converter with `addConversion`. This method takes a conversion callback, which must be convertible to any of the following forms(where `T` is a class derived from `Type`:
* Optional<Type> (T type)
   - This form represents a 1-1 type conversion. It should return nullptr
     or `llvm::None` to signify failure. If `llvm::None` is returned, the
     converter is allowed to try another conversion function to perform
     the conversion.
* Optional<LogicalResult>(T type, SmallVectorImpl<Type> &results)
   - This form represents a 1-N type conversion. It should return
     `failure` or `llvm::None` to signify a failed conversion. If the new
     set of types is empty, the type is removed and any usages of the
     existing value are expected to be removed during conversion. If
     `llvm::None` is returned, the converter is allowed to try another
     conversion function to perform the conversion.

When attempting to convert a type, the TypeConverter walks each of the registered converters starting with the one registered most recently.

Differential Revision: https://reviews.llvm.org/D74584
2020-02-18 16:17:48 -08:00
..
DeclarativeTransforms [mlir] Add primitive transform pattern to rewrite linalg.fill into vector.broadcast form. 2020-01-28 11:21:56 -08:00
IR Remove static registration for dialects, and the "alwayslink" hack for passes 2020-02-12 09:13:02 +00:00
Pass Remove static registration for dialects, and the "alwayslink" hack for passes 2020-02-12 09:13:02 +00:00
TestDialect [mlir] Refactor TypeConverter to add conversions without inheritance 2020-02-18 16:17:48 -08:00
Transforms [mlir] Add MemRef filter to affine data copy optimization 2020-02-14 13:41:45 -08:00
CMakeLists.txt Split Linalg declarative patterns from specific test patterns - NFC 2019-11-21 06:40:17 -08:00