This is an archive of the discontinued LLVM Phabricator instance.

[LoopAccesses] Cache the result of canVectorizeMemory
ClosedPublic

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

Details

Summary

LAA will be an on-demand analysis pass, so we need to cache the result
of the analysis. canVectorizeMemory is renamed to analyzeLoop which
computes the result. canVectorizeMemory becomes the query function for
the cached result.

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

Diff Detail

Event Timeline

anemet updated this revision to Diff 20051.Feb 16 2015, 2:19 PM
anemet retitled this revision from to [LoopAccesses] Cache the result of canVectorizeMemory.
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).
hfinkel edited edge metadata.Feb 16 2015, 4:45 PM

Why not do the analysis in the constructor, and remove the implicit ordering dependency between calling analyzeLoop and calling the other accessor functions?

Why not do the analysis in the constructor, and remove the implicit ordering dependency between calling analyzeLoop and calling the other accessor functions?

I think that should work, let me give it a try.

Why not do the analysis in the constructor, and remove the implicit ordering dependency between calling analyzeLoop and calling the other accessor functions?

I think that should work, let me give it a try.

OK, I know now why we can't do it in *this* patch. LAI is constructed when LVLegality is constructed so we would effectively move running canVectorizeMemory much earlier than before.

On the other hand I can do this after we have the LAA-LAI separation later in D7684 (where the pass is actually created). There, LAI is only created from LVLegality::canVectorizeMem so there is no functional change. Are you OK with that?

hfinkel accepted this revision.Feb 17 2015, 11:16 AM
hfinkel edited edge metadata.

Why not do the analysis in the constructor, and remove the implicit ordering dependency between calling analyzeLoop and calling the other accessor functions?

I think that should work, let me give it a try.

OK, I know now why we can't do it in *this* patch. LAI is constructed when LVLegality is constructed so we would effectively move running canVectorizeMemory much earlier than before.

On the other hand I can do this after we have the LAA-LAI separation later in D7684 (where the pass is actually created). There, LAI is only created from LVLegality::canVectorizeMem so there is no functional change. Are you OK with that?

Yes, that's fine with me. Go ahead with this, it will last for a few minutes ;) LGTM.

This revision is now accepted and ready to land.Feb 17 2015, 11:16 AM
anemet closed this revision.Mar 1 2015, 9:37 PM

r229892