Page MenuHomePhabricator

[LV][VPlan] NFC patch to move LoopVectorizationPlanner class out of LoopVectorize.cpp
ClosedPublic

Authored by hsaito on Dec 19 2017, 4:17 PM.

Details

Summary

Another small step forward to move VPlan stuff outside of LoopVectorize.cpp.

  1. VPlanBuilder.h is renamed to LoopVectorizationPlanner.h
  2. LoopVectorizationPlanner class is moved from LoopVectorize.cpp to LoopVectorizationPlanner.h
  3. LoopVectorizationCostModel::VectorizationFactor class is moved to LoopVectorizationPlanner.h (used by the planner class) --- this needs further streamlining work in later patches and thus all I did was take it out of the CostModel class and moved to the header file.
  4. The callback function had to stay inside LoopVectorize.cpp since it calls an InnerLoopVectorizer member function declared in it.

Next Steps: Make InnerLoopVectorizer, LoopVectorizationCostModel, and other classes more modular and more aligned with VPlan direction, in small increments.

Previous Step was: https://reviews.llvm.org/D41045.

Diff Detail

Repository
rL LLVM

Event Timeline

hsaito created this revision.Dec 19 2017, 4:17 PM
hfinkel accepted this revision.Jan 3 2018, 3:49 AM

LGTM

This revision is now accepted and ready to land.Jan 3 2018, 3:49 AM
hfinkel requested changes to this revision.Jan 3 2018, 4:14 AM

LGTM

Unfortunately, it looks like this triggers a warning, at least in GCC 4.8.5:

In file included from /src/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:50:0:
/src/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h:85:7: warning: ‘llvm::LoopVectorizationPlanner’ has a field ‘llvm::LoopVectorizationPlanner::Legal’ whose type uses the anonymous namespace [enabled by default]
 class LoopVectorizationPlanner {
       ^
/src/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h:85:7: warning: ‘llvm::LoopVectorizationPlanner’ has a field ‘llvm::LoopVectorizationPlanner::CM’ whose type uses the anonymous namespace [enabled by default]

We should fix this before committing.

This revision now requires changes to proceed.Jan 3 2018, 4:14 AM
hsaito updated this revision to Diff 128550.Jan 3 2018, 12:36 PM

Legality and CostModel classes under llvm namespace. Avoiding build warnings.

hfinkel accepted this revision.Jan 6 2018, 6:21 PM

Legality and CostModel classes under llvm namespace. Avoiding build warnings.

Thanks.

This revision is now accepted and ready to land.Jan 6 2018, 6:21 PM
This revision was automatically updated to reflect the committed changes.