Skip to content

Commit 9bbdde2

Browse files
committed
[LV] Remove the redundant using LoopVectorizationPlanner:VPlanPtr
VPlan.h already contains the declaration of VPlanPtr type alias: using VPlanPtr = std::unique_ptr<VPlan>; The LoopVectorizationPlanner class also contains the same declaration of VPlanPtr and therefore LoopVectorize requires a long wording when its methods return VPlanPtr: LoopVectorizationPlanner::VPlanPtr LoopVectorizationPlanner::buildVPlanWithVPRecipes(...) but LoopVectorize.cpp includes VPlan.h (via LoopVectorizationPlanner.h) and can use VPlanPtr from that header. Patch by Pavel Samolysov. Reviewers: hsaito, rengolin, fhahn Reviewed By: fhahn Differential Revision: https://reviews.llvm.org/D62576 llvm-svn: 362126
1 parent ec1b4d1 commit 9bbdde2

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,9 @@ class LoopVectorizationPlanner {
198198
/// The legality analysis.
199199
LoopVectorizationLegality *Legal;
200200

201-
/// The profitablity analysis.
201+
/// The profitability analysis.
202202
LoopVectorizationCostModel &CM;
203203

204-
using VPlanPtr = std::unique_ptr<VPlan>;
205-
206204
SmallVector<VPlanPtr, 4> VPlans;
207205

208206
/// This class is used to enable the VPlan to invoke a method of ILV. This is

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
#include "llvm/Transforms/Vectorize/LoopVectorize.h"
5757
#include "LoopVectorizationPlanner.h"
5858
#include "VPRecipeBuilder.h"
59+
#include "VPlan.h"
5960
#include "VPlanHCFGBuilder.h"
6061
#include "VPlanHCFGTransforms.h"
6162
#include "VPlanPredicator.h"
@@ -6829,8 +6830,7 @@ void LoopVectorizationPlanner::buildVPlansWithVPRecipes(unsigned MinVF,
68296830
}
68306831
}
68316832

6832-
LoopVectorizationPlanner::VPlanPtr
6833-
LoopVectorizationPlanner::buildVPlanWithVPRecipes(
6833+
VPlanPtr LoopVectorizationPlanner::buildVPlanWithVPRecipes(
68346834
VFRange &Range, SmallPtrSetImpl<Value *> &NeedDef,
68356835
SmallPtrSetImpl<Instruction *> &DeadInstructions) {
68366836
// Hold a mapping from predicated instructions to their recipes, in order to
@@ -6954,8 +6954,7 @@ LoopVectorizationPlanner::buildVPlanWithVPRecipes(
69546954
return Plan;
69556955
}
69566956

6957-
LoopVectorizationPlanner::VPlanPtr
6958-
LoopVectorizationPlanner::buildVPlan(VFRange &Range) {
6957+
VPlanPtr LoopVectorizationPlanner::buildVPlan(VFRange &Range) {
69596958
// Outer loop handling: They may require CFG and instruction level
69606959
// transformations before even evaluating whether vectorization is profitable.
69616960
// Since we cannot modify the incoming IR, we need to build VPlan upfront in

0 commit comments

Comments
 (0)