Fix FlatAffineConstraints::getConstantBoundOnDimSize to ensure that
returned bounds on dim size are always non-negative regardless of the
constraints on that dimension. Add an assertion at the user.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
It seems correct to me, that the constant bound is non-negative always, on principle. Was this bound being negative creating any problem in some cases ? If yes, it might be useful to mention that in comments.
Comment Actions
Yes, for any user of that method, a negative bound would be problematic and wrong by definition. For eg. MemRefRegion::getConstantBoundingSizeAndShape is in turn used by memref region compute, which is in turn used by many things including affineDataCopyGenerate. Since this is a lower-level API, we'd like to avoid referring to its users - since the latter change. By design/definition this bound has to be non-negative.