[all-commits] [llvm/llvm-project] 121aab: [MLIR][Affine] Simplify nested modulo operations w...
Krzysztof Drewniak via All-commits
all-commits at lists.llvm.org
Fri Sep 17 12:06:14 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 121aab84d16f659cea539becff2cc2fef82ec152
https://github.com/llvm/llvm-project/commit/121aab84d16f659cea539becff2cc2fef82ec152
Author: Krzysztof Drewniak <Krzysztof.Drewniak at amd.com>
Date: 2021-09-17 (Fri, 17 Sep 2021)
Changed paths:
M mlir/lib/IR/AffineExpr.cpp
M mlir/test/IR/affine-map.mlir
M mlir/test/Transforms/loop-fusion-2.mlir
M mlir/test/Transforms/loop-fusion.mlir
Log Message:
-----------
[MLIR][Affine] Simplify nested modulo operations when able
It is the case that, for all positive a and b such that b divides a
(e mod (a * b)) mod b = e mod b. For example, ((d0 mod 35) mod 5) can
be simplified to (d0 mod 5), but ((d0 mod 35) mod 4) cannot be simplified
further (x = 36 is a counterexample).
This change enables more complex simplifications. For example,
((d0 * 72 + d1) mod 144) mod 9 can now simplify to (d0 * 72 + d1) mod 9
and thus to d1 mod 9. Expressions with chained modulus operators are
reasonably common in tensor applications, and this change _should_
improve code generation for such expressions.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D109930
More information about the All-commits
mailing list