[all-commits] [llvm/llvm-project] 687f78: [MLIR] Fold away divs and mods in affine ops with ...
Uday Bondhugula via All-commits
all-commits at lists.llvm.org
Fri Feb 10 00:11:48 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 687f78210d07fe7f7741273bbaaf8c18864b6191
https://github.com/llvm/llvm-project/commit/687f78210d07fe7f7741273bbaaf8c18864b6191
Author: Uday Bondhugula <uday at polymagelabs.com>
Date: 2023-02-10 (Fri, 10 Feb 2023)
Changed paths:
M mlir/lib/Dialect/Affine/IR/AffineOps.cpp
M mlir/test/Dialect/Affine/canonicalize.mlir
Log Message:
-----------
[MLIR] Fold away divs and mods in affine ops with operand info
Fold away divs and mods in affine maps exploiting operand info during
canonicalization. This simplifies affine map applications such as the ones
below:
```
// Simple ones.
affine.for %i = 0 to 32 {
affine.load %A[%i floordiv 32]
affine.load %A[%i mod 32]
affine.load %A[2 * %i floordiv 64]
affine.load %A[(%i mod 16) floordiv 16]
...
}
// Others.
affine.for %i = -8 to 32 {
// Will be simplified %A[0].
affine.store %cst, %A[2 + (%i - 96) floordiv 64] : memref<64xf32>
}
```
Reviewed By: springerm
Differential Revision: https://reviews.llvm.org/D143456
More information about the All-commits
mailing list