[mlir] Add structural type conversions for SCF dialect.
authorSean Silva <silvasean@google.com>
Fri, 16 Oct 2020 03:17:25 +0000 (20:17 -0700)
committerSean Silva <silvasean@google.com>
Wed, 21 Oct 2020 18:58:27 +0000 (11:58 -0700)
commitf0292ede9bbf8a24607c926b0439db20c203607a
treee28b05d2535c2c811e6128b681c4b975bcea40f2
parentc963bde0152a741d58b9e1e9ac485d8f2e6c6d58
[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
mlir/include/mlir/Dialect/SCF/Passes.h
mlir/include/mlir/Dialect/SCF/Passes.td
mlir/include/mlir/Dialect/SCF/Transforms.h
mlir/include/mlir/Transforms/Bufferize.h
mlir/lib/Dialect/SCF/Transforms/Bufferize.cpp [new file with mode: 0644]
mlir/lib/Dialect/SCF/Transforms/CMakeLists.txt
mlir/lib/Dialect/SCF/Transforms/StructuralTypeConversions.cpp [new file with mode: 0644]
mlir/lib/Transforms/Bufferize.cpp
mlir/test/Dialect/SCF/bufferize.mlir [new file with mode: 0644]