This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Add mergeLocalIds and mergeSymbolIds
ClosedPublic

Authored by Groverkss on Sep 19 2021, 3:19 PM.

Details

Summary

This patch adds mergeLocalIds andmergeSymbolIds as public functions
for FlatAffineConstraints and FlatAffineValueConstraints respectively.

mergeLocalIds is also required to support divisions in intersection,
subtraction, equality checks, and complement for PresburgerSet.

This patch is part of a series of patches aimed at generalizing affine
dependence analysis.

Diff Detail

Event Timeline

Groverkss created this revision.Sep 19 2021, 3:19 PM
Groverkss requested review of this revision.Sep 19 2021, 3:19 PM
bondhugula requested changes to this revision.Sep 19 2021, 7:00 PM
bondhugula added inline comments.
mlir/include/mlir/Analysis/AffineStructures.h
432

The name of this method doesn't reflect its behavior. Given the doc comment, shouldn't this be named: mergeLocalIds?

852

Likewise. Prefer to name the methods imperatively.

mlir/lib/Analysis/AffineStructures.cpp
561

Avoid auto here. As compact and more readable without auto.

565

findId -> llvm::is_contained

This revision now requires changes to proceed.Sep 19 2021, 7:00 PM
Groverkss updated this revision to Diff 373487.Sep 19 2021, 9:14 PM
Groverkss marked 4 inline comments as done.
  • Addressed bondhugula's comments

@bondhugula Thank you for the review!

mlir/lib/Analysis/AffineStructures.cpp
565

I don't think llvm::is_contained can be used here since findIf sets loc to the position of the id and is used for swapping.

Groverkss retitled this revision from Add toCommonLocalSpace and toCommonSymbolSpace to Add mergeLocalIds and mergeSymbolIds.Sep 19 2021, 11:59 PM
Groverkss edited the summary of this revision. (Show Details)
Groverkss retitled this revision from Add mergeLocalIds and mergeSymbolIds to [MLIR] Add mergeLocalIds and mergeSymbolIds.
Groverkss edited the summary of this revision. (Show Details)Sep 20 2021, 2:41 AM
bondhugula accepted this revision.Sep 20 2021, 7:31 PM
This revision is now accepted and ready to land.Sep 20 2021, 7:31 PM
This revision was automatically updated to reflect the committed changes.