This patch implements domain and range restriction for PresburgerRelation
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/include/mlir/Analysis/Presburger/PresburgerRelation.h | ||
---|---|---|
88–103 | These methods should return PresburgerRelation. Methods in PresburgerRelation return a new object unless they have a "inPlace" suffix. | |
mlir/lib/Analysis/Presburger/PresburgerRelation.cpp | ||
127–157 | I would try to reuse PresburgerRelation::intersect as much as possible. We are implementing simplifications in core methods like intersect and it makes it harder to keep track of these things otherwise. |
mlir/include/mlir/Analysis/Presburger/PresburgerRelation.h | ||
---|---|---|
88–103 | Right. What is the rule of thumb for suffixing "inPlace"? For example, inverse, compose, and applyDomain do not have "inPlace" suffixed, even though they mutate the object and do not return a new object. | |
mlir/lib/Analysis/Presburger/PresburgerRelation.cpp | ||
127–157 | The way I can see to implement intersectRange with intersect is to convert the passed PresburgerSet into a PresburgerRelation, insert domain variables to the converted PresburgerRelation to make it intersectable with this, and then call intersect. Would the above be a good way to do it? Do you have any suggestions on other ways to do it? |
mlir/include/mlir/Analysis/Presburger/PresburgerRelation.h | ||
---|---|---|
88–103 | I think we try to do our best in suffixing things. For older methods, we might have to fix this naming later. But for now, since intersect returns a PresburgerRelation, it's best if intersectDomain/Range also does the same. | |
mlir/lib/Analysis/Presburger/PresburgerRelation.cpp | ||
127–157 | I think that sounds like a good way to me. |
mlir/include/mlir/Analysis/Presburger/PresburgerRelation.h | ||
---|---|---|
88 | ||
91–93 | I think using the same set is confusing. I prefer the same documentation as IntegerRelation::intersectRange /// Formally, let the relation `this` be R: A -> B and poly is C, then this /// operation modifies R to be A -> (B intersection C). | |
96 | ||
99–101 | Similarly for this: /// Formally, let the relation `this` be R: A -> B and poly is C, then this /// operation modifies R to be (A intersection C) -> B. | |
mlir/lib/Analysis/Presburger/PresburgerRelation.cpp | ||
35–37 | Braces can be removed. |
mlir/include/mlir/Analysis/Presburger/PresburgerRelation.h | ||
---|---|---|
91–93 | Sure, do you suggest the passed PresburgerSet's name be changed to poly as well? |
mlir/include/mlir/Analysis/Presburger/PresburgerRelation.h | ||
---|---|---|
91–93 | You can just change "poly" to "set" in the documentation. But if you prefer it the other way, you can do that too. As long as the documentation makes sense, it's fine. |