Make the folder more robust against op fold() methods that generate a type mismatch
authorMehdi Amini <joker.eph@gmail.com>
Thu, 4 Feb 2021 01:53:59 +0000 (01:53 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Thu, 4 Feb 2021 01:58:56 +0000 (01:58 +0000)
commita1d5bdf8192fccf5dddeb3c18a187e9ffe2c2dbd
tree74bed2a8e40976770c1509618b23e08937c7169e
parent0f0ce3c12edefd25448e39c4d20718a10d3d42c1
Make the folder more robust against op fold() methods that generate a type mismatch

We could extend this with an interface to allow dialect to perform a type
conversion, but that would make the folder creating operation which isn't
the case at the moment, and isn't necessarily always desirable.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D95991
mlir/lib/Transforms/Utils/FoldUtils.cpp
mlir/test/Transforms/test-canonicalize.mlir
mlir/test/lib/Dialect/Test/TestDialect.cpp
mlir/test/lib/Dialect/Test/TestOps.td