Page MenuHomePhabricator

[MLIR] Generalize Affine dependence analysis using Affine Relations
AbandonedPublic

Authored by Groverkss on Sep 17 2021, 1:29 AM.

Details

Summary

This patch removes code very specific to affine dependence analysis and
refactors it as a FlatAfffineRelation.

A FlatAffineRelation represents a set of ordered pairs (domain -> range) where
"domain" and "range" are tuples of identifiers. These relations are used to
represent an "access relation" for memory access on a memref.
An access relation maps elements of an iteration domain to the element(s) of an
array domain accessed by that iteration of the associated statement through
some array reference.
The dependence relation representing the dependence constraints between two
memory accesses can be built by composing access relation of the destination
access by the inverse of the access relation of source access.

This patch does not change the functionality of the existing dependence
analysis in checkMemrefAccessDependence, but refactors it to be reusable.

Diff Detail

Event Timeline

Groverkss created this revision.Sep 17 2021, 1:29 AM
Groverkss requested review of this revision.Sep 17 2021, 1:29 AM
Groverkss retitled this revision from Generalize Affine dependence analysis using Affine Relations to [MLIR] Generalize Affine dependence analysis using Affine Relations.Sep 17 2021, 1:42 AM
Groverkss updated this revision to Diff 373176.Sep 17 2021, 3:12 AM
  • Fixed formatting issues
arjunp added inline comments.Sat, Sep 18, 10:43 AM
mlir/include/mlir/Analysis/AffineAnalysis.h
109

Typo. (coulkd -> could)

mlir/include/mlir/Analysis/AffineStructures.h
419–421

nit: grammar

428

Should this really be public?

mlir/lib/Analysis/AffineStructures.cpp
419–451

I feel that the changes related to factoring out functionality from mergeAndAlignIds, and the introduction of toCommon*Space, can be split out into a separate patch. toCommonLocalSpace is also required to support divisions in intersection, subtraction, equality checks, and complement.

538

Try to avoid auto.

1775–1808

I feel this can be split out into a separate patch, with appropriate tests.

Groverkss abandoned this revision.Sun, Sep 19, 3:02 PM

As per @arjunp's suggestion, splitting this patch into separate patches.

I agree with @arjunp here. I look forward to seeing separate logically connected revisions!