This is an archive of the discontinued LLVM Phabricator instance.

[LoopAccesses] Add canAnalyzeLoop
ClosedPublic

Authored by anemet on Feb 16 2015, 2:20 PM.

Details

Summary

This allows the analysis to be attempted with any loop. This feature
will be used with -analysis. (LV only requests the analysis on loops
that have already satisfied these tests.)

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

Diff Detail

Event Timeline

anemet updated this revision to Diff 20057.Feb 16 2015, 2:20 PM
anemet retitled this revision from to [LoopAccesses] Add canAnalyzeLoop.
anemet updated this object.
anemet edited the test plan for this revision. (Show Details)
anemet added reviewers: hfinkel, aschwaighofer, nadav.
anemet added a subscriber: Unknown Object (MLST).
anemet added inline comments.Feb 16 2015, 5:19 PM
lib/Analysis/LoopAccessAnalysis.cpp
1280–1282

Based on Hal's comment to an earlier patch in the set, I will try to fold both of these into the constructor.

hfinkel added inline comments.Feb 16 2015, 5:24 PM
lib/Analysis/LoopAccessAnalysis.cpp
835

These should say LoopAccessReport(), not VectorizationReport(), right? Or do we have a special subclass for the analysis itslef? If not, maybe we should?

anemet added inline comments.Feb 16 2015, 5:36 PM
lib/Analysis/LoopAccessAnalysis.cpp
835

Yes, these should be LoopAccessReport, thanks for noticing!

Also I just notices that the comment should be adjust not to mention vectorization in this context.

Why do you think that we'd need a subclass for the analysis? The base class (LoopAccessReport) seems to be sufficient for now.

hfinkel added inline comments.Feb 16 2015, 5:41 PM
lib/Analysis/LoopAccessAnalysis.cpp
835

The vectorizer's subclass says something like "could not vectorize", should the analysis one say something like, "could not analyze for memory dependencies"? (just a though)

anemet added inline comments.Feb 16 2015, 5:49 PM
lib/Analysis/LoopAccessAnalysis.cpp
835

The way I see it is that LoopAccessReport gives you the report on the analysis and then the transform passes extended it with their interpretation of the analysis (e.g. could not vectorize).

For the analysis pass itself I don't think there is much to add but we'll have to see if the reports makes sense on their own...

anemet updated this revision to Diff 20105.Feb 17 2015, 12:42 PM

Turns out that LoopAccessReport is only introduced at a later patch (D7690) so
I was correct using VectorizationReport at this point.

I did change a few comments and messages in canAnalyzeLoop to say analyzer
rather than vectorizer.

hfinkel accepted this revision.Feb 17 2015, 7:29 PM
hfinkel edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Feb 17 2015, 7:29 PM
anemet closed this revision.Mar 1 2015, 9:35 PM

r229895