This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Simplex: fix a bug when rolling back a Simplex with no solutions
ClosedPublic

Authored by arjunp on Nov 25 2021, 1:37 PM.

Details

Summary

Previously, when adding a constraint to a Simplex that is already marked
as having no solutions (marked empty), the Simplex would be marked empty again,
and a second UnmarkEmpty entry would be pushed to the undo log. When rolling
back, Simplex should be unmarked empty only after rolling back past the
creation of the first constraint that made it empty.

Diff Detail

Event Timeline

arjunp created this revision.Nov 25 2021, 1:37 PM
arjunp requested review of this revision.Nov 25 2021, 1:37 PM

Note: the failing test will pass once the patch D114614 is landed.

Groverkss accepted this revision.Nov 26 2021, 6:02 AM

LGTM. Just some minor comments.

mlir/lib/Analysis/Presburger/Simplex.cpp
358
mlir/unittests/Analysis/Presburger/SimplexTest.cpp
16–20

I think this doc comment should be updated to reflect the new check.

33

Could you add the comment // (u - v) <= -3 just for consistency?

This revision is now accepted and ready to land.Nov 26 2021, 6:02 AM
arjunp updated this revision to Diff 390049.Nov 26 2021, 7:08 AM

Address Kunwar's comments.

arjunp updated this revision to Diff 390072.Nov 26 2021, 8:14 AM

Rebase on the landed parent patch. This should fix the build.