[mlir][Arith] Make integer max/min commutative.
authorjacquesguan <Jianjian.Guan@streamcomputing.com>
Tue, 22 Mar 2022 13:00:33 +0000 (21:00 +0800)
committerjacquesguan <Jianjian.Guan@streamcomputing.com>
Wed, 23 Mar 2022 02:17:36 +0000 (10:17 +0800)
commit75f0d12ebfc9616957991ffc4be7722b1c3a871b
tree359b3227335fd13555e2655c245a28105c65f00d
parentb7a4b6738059ec34afbf416160cbce522fe99d62
[mlir][Arith] Make integer max/min commutative.

Make MaxSI, MaxUI, MinSI and MinUI commutative, so they will be canonicalized to have its constants appear as the second operand. And the constant folder will match more cases.

Differential Revision: https://reviews.llvm.org/D122225
mlir/include/mlir/Dialect/Arithmetic/IR/ArithmeticOps.td
mlir/test/Dialect/Arithmetic/canonicalize.mlir