This is an archive of the discontinued LLVM Phabricator instance.

[mlir][affine][analysis][NFC] Simplify FlatAffineValueConstraints API
ClosedPublic

Authored by springerm on Mar 13 2023, 7:07 AM.

Details

Summary
  • Remove reset function. Use copy assignment directly (instead of within reset).
  • Fix potential nullptr dereference in getFlattenedAffineExprs.
  • Make constraint set optional in checkMemrefAccessDependence.

Diff Detail

Event Timeline

springerm created this revision.Mar 13 2023, 7:07 AM
springerm requested review of this revision.Mar 13 2023, 7:07 AM
springerm retitled this revision from [mlir][affine][analysis][NFC] Simplify FlatAffineConstraints API to [mlir][affine][analysis][NFC] Simplify FlatAffineValueConstraints API.Mar 13 2023, 7:07 AM
arjunp added inline comments.Mar 13 2023, 10:53 AM
mlir/lib/Dialect/Affine/Analysis/Utils.cpp
63–67

I would prefer to just add an FAVC constructor.

springerm updated this revision to Diff 504991.Mar 14 2023, 2:18 AM

address comments

springerm marked an inline comment as done.Mar 14 2023, 2:18 AM
arjunp accepted this revision.Mar 14 2023, 10:33 AM

Thanks, SGTM with a few nits below

mlir/include/mlir/Dialect/Affine/Analysis/AffineStructures.h
53

I think I would slightly prefer just adding another overload that maps to optional like you were doing earlier, since I only see two versions being used.

If keeping the template version, ArrayRef<ValArgTy> would give better error messages.

108

Same here.

mlir/lib/Dialect/Affine/Analysis/AffineAnalysis.cpp
659–660

Why return dependenceConstraints when there is no dependence? Is the specific set of constraints ever relevant when there was no dependence?

This revision is now accepted and ready to land.Mar 14 2023, 10:33 AM
This revision was automatically updated to reflect the committed changes.
springerm marked 3 inline comments as done.