[all-commits] [llvm/llvm-project] 4589dd: [mlir][DialectConversion] Enable deeper integratio...

River Riddle via All-commits all-commits at lists.llvm.org
Thu Jul 23 19:44:55 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 4589dd924dfc43c846652b85825e291af0d7428a
      https://github.com/llvm/llvm-project/commit/4589dd924dfc43c846652b85825e291af0d7428a
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-07-23 (Thu, 23 Jul 2020)

  Changed paths:
    M mlir/include/mlir/Transforms/DialectConversion.h
    M mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
    M mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp
    M mlir/lib/IR/Value.cpp
    M mlir/lib/Transforms/DialectConversion.cpp
    M mlir/test/Conversion/StandardToLLVM/standard-to-llvm.mlir
    M mlir/test/Dialect/SPIRV/Transforms/abi-load-store.mlir
    A mlir/test/Transforms/test-legalize-type-conversion.mlir
    M mlir/test/lib/Dialect/Test/TestPatterns.cpp

  Log Message:
  -----------
  [mlir][DialectConversion] Enable deeper integration of type conversions

This revision adds support for much deeper type conversion integration into the conversion process, and enables auto-generating cast operations when necessary. Type conversions are now largely automatically managed by the conversion infra when using a ConversionPattern with a provided TypeConverter. This removes the need for patterns to do type cast wrapping themselves and moves the burden to the infra. This makes it much easier to perform partial lowerings when type conversions are involved, as any lingering type conversions will be automatically resolved/legalized by the conversion infra.

To support this new integration, a few changes have been made to the type materialization API on TypeConverter. Materialization has been split into three separate categories:
* Argument Materialization: This type of materialization is used when converting the type of block arguments when calling `convertRegionTypes`. This is useful for contextually inserting additional conversion operations when converting a block argument type, such as when converting the types of a function signature.
* Source Materialization: This type of materialization is used to convert a legal type of the converter into a non-legal type, generally a source type. This may be called when uses of a non-legal type persist after the conversion process has finished.
* Target Materialization: This type of materialization is used to convert a non-legal, or source, type into a legal, or target, type. This type of materialization is used when applying a pattern on an operation, but the types of the operands have not yet been converted.

Differential Revision: https://reviews.llvm.org/D82831




More information about the All-commits mailing list