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.
Earlier in https://reviews.llvm.org/D140043 I thought "hey why is the lowering of affine floordiv missing out on opportunity to generate arith.floordivsi". Now I understand why --- arith.floordivsi being more general (supports RHS<0) and expanding in populateCeilFloorDivExpandOpsPatterns to 2 arith.divsi is a solid reason to keep a custom lowering of affine floordiv directly to arith.divsi.