[MLIR] Simplify semi-affine expressions
Simplify semi-affine expression for the operations like ceildiv, floordiv and modulo by any given symbol by checking divisibilty by that symbol. Some properties used in simplification are: 1) Commutative property of the floordiv and ceildiv: ((expr1 floordiv expr2) floordiv expr3 ) = ((expr1 floordiv expr3) floordiv expr2) ((expr1 ceildiv expr2) ceildiv expr3 ) = ((expr1 ceildiv expr3) ceildiv expr2) While simplification if operations are different no simplification is possible as there is no property that simplify expressions like these: ((expr1 ceildiv expr2) floordiv expr3) or ((expr1 floordiv expr2) ceildiv expr3). 2) If both expr1 and expr2 are divisible by the expr3 then: (expr1 % expr2) / expr3 = ((expr1 / expr3) % (expr2 / expr3)) where / is divide symbol. 3) If expr1 is divisible by expr2 then expr1 % expr2 = 0. Signed-off-by:Yash Jain <yash.jain@polymagelabs.com> Differential Revision: https://reviews.llvm.org/D84920
Loading
Please register or sign in to comment