Previously, when an input set had a duplicate division, the duplicates might
be removed by a call to mergeLocalIds due to being detected as being duplicate
for the first time. The subtraction implementation cannot handle existing
locals being removed, so this would lead to unexpected behaviour. Resolve this
by removing all the duplicates up front.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM.
mlir/lib/Analysis/Presburger/IntegerRelation.cpp | ||
---|---|---|
1099–1103 | We should later make it so that the merge function returns false if the divs belong to the same relation, such that it does not remove duplicate divisions. But for now, it's fine. |
mlir/lib/Analysis/Presburger/IntegerRelation.cpp | ||
---|---|---|
1099–1103 | We'll have to think what that even means. Let's say the same div occurs twice in each set. What is the guarantee on the number of occurrences in the final set? Will it be the max of the number of occurrences in each set? Seems weird. I think it's better to just have the users remove duplicates upfront if they don't want this to happen. Anyway, we should eventually just make addFloorDiv not add duplicates maybe, at least by default. | |
1099–1103 | (Not a perfect solution but that might avoid this problem entirely in many cases.) |
We should later make it so that the merge function returns false if the divs belong to the same relation, such that it does not remove duplicate divisions. But for now, it's fine.