[mlir][Arithmetic] Add common constant folder function for type cast ops.
authorjacquesguan <Jianjian.Guan@streamcomputing.com>
Mon, 11 Apr 2022 09:24:43 +0000 (09:24 +0000)
committerjacquesguan <Jianjian.Guan@streamcomputing.com>
Wed, 13 Apr 2022 02:11:59 +0000 (02:11 +0000)
commit605fc89a613e0a2215de35b0705ebd09a8fa5e1d
tree4105684e9ecb1103449284186523de1952641bdd
parent47a9528fb46a8b991d1f429e8d6b8b2390168e27
[mlir][Arithmetic] Add common constant folder function for type cast ops.

This revision replaces current type cast constant folder with a new common type cast constant folder function template.
It will cover all former folder and support fold the constant splat and vector.

Differential Revision: https://reviews.llvm.org/D123489
mlir/include/mlir/Dialect/CommonFolders.h
mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp
mlir/test/Dialect/Arithmetic/canonicalize.mlir