Refactor DialectConversion to use 'materializeConversion' when a type conversion...
authorRiver Riddle <riverriddle@google.com>
Fri, 28 Jun 2019 18:28:30 +0000 (11:28 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Fri, 28 Jun 2019 18:29:04 +0000 (11:29 -0700)
commit7c755d06aa6681e25cd1d289b937a505de47c1f8
treea3e34f96edd3a551284d58079bf2849adb6cecbc
parent266841751f072828c5982c972d9a482cda201659
Refactor DialectConversion to use 'materializeConversion' when a type conversion must persist after the conversion has finished.

During conversion, if a type conversion has dangling uses a type conversion must persist after conversion has finished to maintain valid IR. In these cases, we now query the TypeConverter to materialize a conversion for us. This allows for the default case of a full conversion to continue working as expected, but also handle the degenerate cases more robustly.

PiperOrigin-RevId: 255637171
mlir/examples/toy/Ch5/mlir/LateLowering.cpp
mlir/include/mlir/Transforms/DialectConversion.h
mlir/lib/Transforms/DialectConversion.cpp
mlir/test/Transforms/test-legalizer.mlir
mlir/test/lib/TestDialect/TestOps.td
mlir/test/lib/TestDialect/TestPatterns.cpp