Allow non-constant divisors in affine mod, floordiv, ceildiv.
authorBenoit Jacob <benoitjacob@google.com>
Thu, 15 Dec 2022 02:00:39 +0000 (02:00 +0000)
committerBenoit Jacob <benoitjacob@google.com>
Sat, 17 Dec 2022 02:24:02 +0000 (02:24 +0000)
commiteec575e548d114d96acb673ccb9b8a1ef795465b
tree62d9d5af3ed4cb024d5d6f4eeb7408f0e27369f8
parent428f36401b1b695fd501ebfdc8773bed8ced8d4e
Allow non-constant divisors in affine mod, floordiv, ceildiv.

The requirement that divisor>0 is not enforced here outside of the
constant case, but how to enforce it? If I understand correctly, it is
UB and while it is nice to be able to deterministically intercept UB,
that isn't always feasible. Hopefully, keeping the existing
enforcement in the constant case is enough.

Differential Revision: https://reviews.llvm.org/D140079
mlir/lib/Dialect/Affine/Utils/Utils.cpp
mlir/test/Conversion/AffineToStandard/lower-affine.mlir