[PATCH] D62576: Remove the redundant using LoopVectorizationPlanner:VPlanPtr

Pavel Samolysov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 29 03:05:42 PDT 2019


psamolysov created this revision.
psamolysov added reviewers: hsaito, rengolin, fhahn.
psamolysov added a project: LLVM.
Herald added subscribers: psnobl, rogfer01, rkruppe, tschuett, bollu, hiraditya.

  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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D62576

Files:
  llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp


Index: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
===================================================================
--- llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -6818,8 +6818,7 @@
   }
 }
 
-LoopVectorizationPlanner::VPlanPtr
-LoopVectorizationPlanner::buildVPlanWithVPRecipes(
+VPlanPtr LoopVectorizationPlanner::buildVPlanWithVPRecipes(
     VFRange &Range, SmallPtrSetImpl<Value *> &NeedDef,
     SmallPtrSetImpl<Instruction *> &DeadInstructions) {
   // Hold a mapping from predicated instructions to their recipes, in order to
@@ -6943,8 +6942,7 @@
   return Plan;
 }
 
-LoopVectorizationPlanner::VPlanPtr
-LoopVectorizationPlanner::buildVPlan(VFRange &Range) {
+VPlanPtr LoopVectorizationPlanner::buildVPlan(VFRange &Range) {
   // Outer loop handling: They may require CFG and instruction level
   // transformations before even evaluating whether vectorization is profitable.
   // Since we cannot modify the incoming IR, we need to build VPlan upfront in
Index: llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
===================================================================
--- llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
+++ llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
@@ -198,11 +198,9 @@
   /// The legality analysis.
   LoopVectorizationLegality *Legal;
 
-  /// The profitablity analysis.
+  /// The profitability analysis.
   LoopVectorizationCostModel &CM;
 
-  using VPlanPtr = std::unique_ptr<VPlan>;
-
   SmallVector<VPlanPtr, 4> VPlans;
 
   /// This class is used to enable the VPlan to invoke a method of ILV. This is


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62576.201849.patch
Type: text/x-patch
Size: 1648 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190529/e2933deb/attachment.bin>


More information about the llvm-commits mailing list