This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][Presburger] fix vector update in coalesce
ClosedPublic

Authored by webmiche on Mar 9 2022, 11:58 PM.

Details

Summary

When addCoalescedPolyhedron was called with j == n - 1,
the polyhedrons-vector was not properly updated (the
IntegerPolyhedron at position n - 2 was "lost"). This patch adds
special handling to that case and a regression testcase.

Diff Detail

Event Timeline

webmiche created this revision.Mar 9 2022, 11:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 9 2022, 11:58 PM
webmiche requested review of this revision.Mar 9 2022, 11:58 PM
webmiche edited the summary of this revision. (Show Details)Mar 10 2022, 12:03 AM
Groverkss accepted this revision.Mar 10 2022, 12:57 AM

LGTM.

mlir/lib/Analysis/Presburger/PresburgerSet.cpp
412–414

This comment would better fit inside the if condition.

This revision is now accepted and ready to land.Mar 10 2022, 12:57 AM
webmiche updated this revision to Diff 414295.Mar 10 2022, 1:07 AM

addressed comment.

webmiche marked an inline comment as done.Mar 10 2022, 1:12 AM
arjunp added inline comments.Mar 10 2022, 1:45 AM
mlir/lib/Analysis/Presburger/PresburgerSet.cpp
425–433

Please add a comment here explaining why it's correct for other possible edge cases with i or j being n - 1 or n - 2.

webmiche updated this revision to Diff 414306.EditedMar 10 2022, 1:57 AM

address comment.

webmiche marked an inline comment as done.Mar 10 2022, 1:57 AM
This revision was automatically updated to reflect the committed changes.