This is an archive of the discontinued LLVM Phabricator instance.

[mlir][SCF] Loop lb/ub are symbols during Affine Min/Max canonicalization
ClosedPublic

Authored by springerm on Aug 17 2022, 3:43 AM.

Details

Summary

This fixes a bug in SCF/AffineCanonicalizationUtils.cpp. Loop lb/ub were previously considered dimensions, which caused a crash when a (non-optimizable) affine.min / affine.max expression was processed (due to multiplication of two dims). Lb/ub are now considered symbols and symbols may be multiplied. (The scope of the analysis is "within the loop body", at which point lb/ub are constants.)

Depends On D131949

Diff Detail

Event Timeline

springerm created this revision.Aug 17 2022, 3:43 AM
springerm requested review of this revision.Aug 17 2022, 3:43 AM
Herald added a project: Restricted Project. · View Herald Transcript
springerm planned changes to this revision.Aug 17 2022, 3:50 AM
springerm updated this revision to Diff 453265.Aug 17 2022, 5:51 AM

fix bug IntegerRelation

Groverkss added inline comments.Aug 17 2022, 6:03 AM
mlir/lib/Analysis/Presburger/IntegerRelation.cpp
271–272 ↗(On Diff #453265)

Thanks for fixing this bug! The behaviour should be to return the absolute position of the variable to match insertVar. Instead of doing this, could you change the doc of appendVar to say "Return the absolute column position (i.e., not relative to the kind of variable) of the first added variable"? Having different return behaviour for insertVar and appendVar could be confusing.

springerm updated this revision to Diff 453271.Aug 17 2022, 6:30 AM

address comments

springerm marked an inline comment as done.Aug 17 2022, 6:30 AM
This revision is now accepted and ready to land.Aug 18 2022, 12:46 AM