llvm-project/mlir/lib/Conversion/PDLToPDLInterp
River Riddle 3c75228991 [mlir:PDLInterp] Refactor the implementation of result type inferrence
The current implementation uses a discrete "pdl_interp.inferred_types"
operation, which acts as a "fake" handle to a type range. This op is
used as a signal to pdl_interp.create_operation that types should be
inferred. This is terribly awkward and clunky though:

* This op doesn't have a byte code representation, and its conversion
  to bytecode kind of assumes that it is only used in a certain way. The
  current lowering is also broken and seemingly untested.

* Given that this is a different operation, it gives off the assumption
  that it can be used multiple times, or that after the first use
  the value contains the inferred types. This isn't the case though,
  the resultant type range can never actually be used as a type range.

This commit refactors the representation by removing the discrete
InferredTypesOp, and instead adds a UnitAttr to
pdl_interp.CreateOperation that signals when the created operations
should infer their types. This leads to a much much cleaner abstraction,
a more optimal bytecode lowering, and also allows for better error
handling and diagnostics when a created operation doesn't actually
support type inferrence.

Differential Revision: https://reviews.llvm.org/D124587
2022-05-01 12:25:05 -07:00
..
CMakeLists.txt Implementation of the root ordering algorithm 2021-11-26 18:11:37 +05:30
PDLToPDLInterp.cpp [mlir:PDLInterp] Refactor the implementation of result type inferrence 2022-05-01 12:25:05 -07:00
Predicate.cpp [MLIR][PDL] Refactor the positions for multi-root patterns. 2022-01-04 08:03:44 +05:30
Predicate.h [mlir:PDL] Remove the ConstantParams support from native Constraints/Rewrites 2022-03-19 13:28:24 -07:00
PredicateTree.cpp [mlir:PDL] Remove the ConstantParams support from native Constraints/Rewrites 2022-03-19 13:28:24 -07:00
PredicateTree.h Adjust "end namespace" comment in MLIR to match new agree'd coding style 2021-12-08 06:05:26 +00:00
RootOrdering.cpp [MLIR][PDL] Clear up the terminology in the root ordering graph. 2021-12-22 19:10:29 +00:00
RootOrdering.h [MLIR][PDL] Clear up the terminology in the root ordering graph. 2021-12-22 19:10:29 +00:00