[MLIR][Arith] Fold trunci with ext if the bit width of the input type of ext is great...
authorliqinweng <Liqin.Weng@streamcomputing.com>
Thu, 6 Apr 2023 13:08:34 +0000 (21:08 +0800)
committerliqinweng <Liqin.Weng@streamcomputing.com>
Thu, 6 Apr 2023 13:08:39 +0000 (21:08 +0800)
commitdd39f9b418379264ceb6a232dc0b2a5fb18a4203
tree8b45b0538aecc8409cc938ac8c68064759f3fc90
parent203cd159b6a9aca7a48c1847b0ff745beebf4b5e
[MLIR][Arith] Fold trunci with ext if the bit width of the input type of ext is greater than the

This patch is mainly to deal with folding trunci with ext,as flows:
    trunci(zexti(a)) -> trunci(a)
    trunci(zexti(a)) -> trunci(a)

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D140604
mlir/lib/Dialect/Arith/IR/ArithOps.cpp
mlir/test/Dialect/Arith/canonicalize.mlir