This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Analysis][NFC] Reimplement FlatAffineConstraints::composeMap
ClosedPublic

Authored by springerm on Aug 10 2021, 4:27 AM.

Details

Summary

Reimplement this function in terms of composeMatchingMap.

Also fix a bug in composeMatchingMap where local dims of this could be missing in localCst.

Depends On D107729

Diff Detail

Event Timeline

springerm created this revision.Aug 10 2021, 4:27 AM
springerm requested review of this revision.Aug 10 2021, 4:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 10 2021, 4:27 AM
ftynse accepted this revision.Aug 10 2021, 8:00 AM
mlir/lib/Analysis/AffineStructures.cpp
389–390

Nit: this doesn't look particularly helpful as doxygen (///) documentation, the function declaration already has a proper comment. Let's just drop this one.

395–398

Ditto, this conflicts with the doxygen comment on the declaration and I don't know which one will get picked. Let's sink this comment into the function and keep it as //.

This revision is now accepted and ready to land.Aug 10 2021, 8:00 AM
springerm marked 2 inline comments as done.Aug 10 2021, 11:40 PM

The main part of this commit is the alignment of the affine map with this constraint set and reusing composeMatchingMap. This cannot be tested AffineStructuresTest.cpp because I need real IR, in particular Values to test the association of columns with those values. However, the function is (indirectly) covered by other unit tests such as Dialect/Affine/dma-generate.mlir.

Is there a way to create "fake" Values in unit tests? (Without writing any IR.) Many functions in this file could be covered by a very small and concise unit test then.

This revision was landed with ongoing or failed builds.Aug 10 2021, 11:56 PM
This revision was automatically updated to reflect the committed changes.