This is an archive of the discontinued LLVM Phabricator instance.

[VPlan] Introduce VPLoopInfo analysis.
ClosedPublic

Authored by dcaballe on Jul 1 2018, 10:25 PM.

Details

Summary

Context: Patch Series #1 for outer loop vectorization support in LV
using VPlan. (RFC: http://lists.llvm.org/pipermail/llvm-dev/2017-December/119523.html).

The patch introduces loop analysis (VPLoopInfo/VPLoop) for VPBlockBases.
This analysis will be necessary to perform some H-CFG transformations and
detect and introduce regions representing a loop in the H-CFG.

Diff Detail

Repository
rL LLVM

Event Timeline

dcaballe created this revision.Jul 1 2018, 10:25 PM
dcaballe updated this revision to Diff 155234.Jul 12 2018, 11:27 AM

Rebasing this patch on top of D49032.

fhahn added inline comments.Jul 13 2018, 6:43 AM
lib/Transforms/Vectorize/VPlan.h
1123 ↗(On Diff #153668)

Could the VPlan just store a VPLoopInfo object instead of using a raw pointer?

It would have the advantage of not needing dynamic memory management and it would be clear that each VPlan owns its VPLoopInfo. Instead having setVPLoopInfo we would have something like analyze() which would compute the DT and LoopInfo.

dcaballe added inline comments.Jul 17 2018, 10:21 PM
lib/Transforms/Vectorize/VPlan.h
1123 ↗(On Diff #153668)

Store an object instead is much better, definitely! Thanks!

However, I'm not too sure about the analyze() part. Some analyses will be computed at different times. Some others, such as as DT for the plain CFG, are temporal (DT becomes invalid once regions are introduced so we don't even want to store it in VPlan). Would it be acceptable to keep the analysis computation of VPLoopInfo as is, at least, for now?

dcaballe updated this revision to Diff 156017.Jul 17 2018, 10:50 PM

Making VPLoopInfo object a member of VPlan.

fhahn accepted this revision.Jul 18 2018, 11:41 AM

LGTM, thanks

This revision is now accepted and ready to land.Jul 18 2018, 11:41 AM

Thanks for the review, Florian!
I'll commit this once D48815 is approved and committed.

This revision was automatically updated to reflect the committed changes.