Add support for an analysis mode to DialectConversion.
authorRiver Riddle <riverriddle@google.com>
Thu, 25 Jul 2019 18:30:41 +0000 (11:30 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Thu, 25 Jul 2019 18:31:07 +0000 (11:31 -0700)
commit1293708473ee343078b11c7e9f9572618b624403
tree88e81d9b5fa1a95f6379093cca585d311bb9e150
parentdd652ce9cc8d49da359aea92cef108ec90f8e107
Add support for an analysis mode to DialectConversion.

This mode analyzes which operations are legalizable to the given target if a conversion were to be applied, i.e. no rewrites are ever performed even on success. This mode is useful for device partitioning or other utilities that may want to analyze the effect of conversion to different targets before performing it.

The analysis method currently just fills a provided set with the operations that were found to be legalizable. This can be extended in the future to capture more information as necessary.

PiperOrigin-RevId: 259987105
mlir/include/mlir/Transforms/DialectConversion.h
mlir/lib/Transforms/DialectConversion.cpp
mlir/test/Transforms/test-legalizer-analysis.mlir [new file with mode: 0644]
mlir/test/lib/TestDialect/TestPatterns.cpp