[mlir][Arithmetic] Use matchPattern to simplify code.
authorjacquesguan <Jianjian.Guan@streamcomputing.com>
Fri, 22 Apr 2022 07:46:01 +0000 (07:46 +0000)
committerjacquesguan <Jianjian.Guan@streamcomputing.com>
Fri, 22 Apr 2022 08:42:51 +0000 (08:42 +0000)
commitabc17a67519747be36f1fd03e227c5103da4c677
tree7381e7ef20fd7b320ea65fa6d3c931ee4cd4b773
parent091c2f953dd6328fd6dd0722a4a8ba47902a65bb
[mlir][Arithmetic] Use matchPattern to simplify code.

This patch replaces some code with matchPattern and move them before the constant folder function in order to avoid redundant invoking.

Differential Revision: https://reviews.llvm.org/D124235
mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp