[all-commits] [llvm/llvm-project] f0292e: [mlir] Add structural type conversions for SCF dia...

Sean Silva via All-commits all-commits at lists.llvm.org
Wed Oct 21 11:59:17 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f0292ede9bbf8a24607c926b0439db20c203607a
      https://github.com/llvm/llvm-project/commit/f0292ede9bbf8a24607c926b0439db20c203607a
  Author: Sean Silva <silvasean at google.com>
  Date:   2020-10-21 (Wed, 21 Oct 2020)

  Changed paths:
    M mlir/include/mlir/Dialect/SCF/Passes.h
    M mlir/include/mlir/Dialect/SCF/Passes.td
    M mlir/include/mlir/Dialect/SCF/Transforms.h
    M mlir/include/mlir/Transforms/Bufferize.h
    A mlir/lib/Dialect/SCF/Transforms/Bufferize.cpp
    M mlir/lib/Dialect/SCF/Transforms/CMakeLists.txt
    A mlir/lib/Dialect/SCF/Transforms/StructuralTypeConversions.cpp
    M mlir/lib/Transforms/Bufferize.cpp
    A mlir/test/Dialect/SCF/bufferize.mlir

  Log Message:
  -----------
  [mlir] Add structural type conversions for SCF dialect.

A "structural" type conversion is one where the underlying ops are
completely agnostic to the actual types involved and simply need to update
their types. An example of this is scf.if -- the scf.if op and the
corresponding scf.yield ops need to update their types accordingly to the
TypeConverter, but otherwise don't care what type conversions are happening.

To test the structural type conversions, it is convenient to define a
bufferize pass for a dialect, which exercises them nicely.

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


  Commit: 57b338c08a4942bda6e58c77870c657c53b6fb5b
      https://github.com/llvm/llvm-project/commit/57b338c08a4942bda6e58c77870c657c53b6fb5b
  Author: Sean Silva <silvasean at google.com>
  Date:   2020-10-21 (Wed, 21 Oct 2020)

  Changed paths:
    M mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
    M mlir/include/mlir/Dialect/Shape/Transforms/Passes.h
    M mlir/lib/Dialect/Shape/Transforms/Bufferize.cpp
    M mlir/lib/Dialect/Shape/Transforms/CMakeLists.txt
    A mlir/lib/Dialect/Shape/Transforms/StructuralTypeConversions.cpp
    M mlir/test/Dialect/Shape/bufferize.mlir

  Log Message:
  -----------
  [mlir][shape] Split out structural type conversions for shape dialect.

A "structural" type conversion is one where the underlying ops are
completely agnostic to the actual types involved and simply need to update
their types. An example of this is shape.assuming -- the shape.assuming op
and the corresponding shape.assuming_yield op need to update their types
accordingly to the TypeConverter, but otherwise don't care what type
conversions are happening.

Also, the previous conversion code would not correctly materialize
conversions for the shape.assuming_yield op. This should have caused a
verification failure, but shape.assuming's verifier wasn't calling
RegionBranchOpInterface::verifyTypes (which for reasons can't be called
automatically as part of the trait verification, and requires being
called manually). This patch also adds that verification.

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


Compare: https://github.com/llvm/llvm-project/compare/c963bde0152a...57b338c08a49


More information about the All-commits mailing list