This is an archive of the discontinued LLVM Phabricator instance.

[Polly][NFC][ScopBuilder] Move buildAliasChecks and its implementing methods to ScopBuilder
ClosedPublic

Authored by domada on Jun 23 2019, 2:43 PM.

Details

Summary

Scope of changes:

  1. Moved buildAliasChecks to ScopBuilder.
  2. Moved buildAliasGroup to ScopBuilder.
  3. Moved buildAliasGroups to ScopBuilder.
  4. Moved buildAliasGroupsForAccesses to ScopBuilder.
  5. Moved splitAliasGroupsByDomain to ScopBuilder.
  6. Moved addNonEmptyDomainConstraints to ScopBuilder.
  7. Moved buildMinMaxAccess to ScopBuilder.
  8. Moved calculateMinMaxAccess to ScopBuilder.
  9. Moved getAccessDomain to ScopBuilder.
  10. Moved command line options used only by buildAliasChecks functions to ScopBuilder
  11. Refactored buildAliasGroup function. Added addAliasGroup function to Scop class for pushing back calculated min/max accesses.
  12. Added function incrementNumberOfAliasingAssumptions which increments number of statistic variable AssumptionsAliasing. AssumptionsAliasing variable is defined by STATISTIC macro inside ScopInfo.cpp and it is also used by function trackAssumption from Scop class.
  13. Added reference to OptimizationRemarkEmitter to ScopBuilder class.
  14. Moved calculateMinMaxAccess function to ScopBuilder class.

Diff Detail

Event Timeline

domada created this revision.Jun 23 2019, 2:43 PM

Please let me know if such big patch is acceptable. I have moved all functions referenced only by buildAliasChecks function to ScopBuilder class.

Please let me know if such big patch is acceptable. I have moved all functions referenced only by buildAliasChecks function to ScopBuilder class.

Yes, if all changes have a common topic, in this case moving the alias check functionality. Even if we wanted tom move them, I don't think hasFeasibleRuntimeContext and lookupBasePtrAccess are specific to this functionality.

Could you change the title to reflect the topic, such as "Move buildAliasChecks and its implementing methods to ScopBuilder"?

polly/include/polly/ScopBuilder.h
35–38

AFICS these types are only used in private functions, i.e. could be private themselves.

polly/include/polly/ScopInfo.h
2035

I think this accessor might still be useful after havind constructed a SCoP on should stay.

2502

This function might also be useful after the SCoP has been constructed and should stay.

2601

I don't think modifying an object's internals through a get-accessor is a good idea.

polly/lib/Analysis/ScopBuilder.cpp
2336

After being moved to ScopBuilder, buildAliasChecks can just use this->AA. Similarly, as a uitility object ORE can be made a member of ScopBuilder so it's not needed to be passed every time.

domada updated this revision to Diff 207414.Jul 1 2019, 2:59 PM
domada retitled this revision from [Polly][NFC][ScopBuilder] Move buildAliasChecks to ScopBuilder to [Polly][NFC][ScopBuilder] Move buildAliasChecks and its implementing methods to ScopBuilder.
domada edited the summary of this revision. (Show Details)

Applied cod review remarks:

  1. Leave lookupBasePtrAccess in Scop class.
  2. Leave hasFeasibleRuntimeContext in Scop class.
  3. Added Optimization Remark Emitter to ScopBuilder class,
  4. Make types AliasGroupTy and AliasGroupVectorTy private.
domada marked 5 inline comments as done.Jul 1 2019, 3:06 PM
Meinersbur accepted this revision.Jul 9 2019, 12:00 PM

LGTM! Many thanks!

Can I commit for you?

polly/include/polly/ScopInfo.h
2605–2607

[suggestion]

MinMaxAliasGroups.emplace_back(MinMaxAccessesReadWrite, MinMaxAccessesReadOnly);
This revision is now accepted and ready to land.Jul 9 2019, 12:00 PM
This revision was automatically updated to reflect the committed changes.