LLVM 19.0.0git
LoopVectorizationPlanner.h
Go to the documentation of this file.
1//===- LoopVectorizationPlanner.h - Planner for LoopVectorization ---------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8///
9/// \file
10/// This file provides a LoopVectorizationPlanner class.
11/// InnerLoopVectorizer vectorizes loops which contain only one basic
12/// LoopVectorizationPlanner - drives the vectorization process after having
13/// passed Legality checks.
14/// The planner builds and optimizes the Vectorization Plans which record the
15/// decisions how to vectorize the given loop. In particular, represent the
16/// control-flow of the vectorized version, the replication of instructions that
17/// are to be scalarized, and interleave access groups.
18///
19/// Also provides a VPlan-based builder utility analogous to IRBuilder.
20/// It provides an instruction-level API for generating VPInstructions while
21/// abstracting away the Recipe manipulation details.
22//===----------------------------------------------------------------------===//
23
24#ifndef LLVM_TRANSFORMS_VECTORIZE_LOOPVECTORIZATIONPLANNER_H
25#define LLVM_TRANSFORMS_VECTORIZE_LOOPVECTORIZATIONPLANNER_H
26
27#include "VPlan.h"
28#include "llvm/ADT/SmallSet.h"
30
31namespace llvm {
32
33class LoopInfo;
34class DominatorTree;
35class LoopVectorizationLegality;
36class LoopVectorizationCostModel;
37class PredicatedScalarEvolution;
38class LoopVectorizeHints;
39class OptimizationRemarkEmitter;
40class TargetTransformInfo;
41class TargetLibraryInfo;
42class VPRecipeBuilder;
43
44/// VPlan-based builder utility analogous to IRBuilder.
45class VPBuilder {
46 VPBasicBlock *BB = nullptr;
48
49 /// Insert \p VPI in BB at InsertPt if BB is set.
50 VPInstruction *tryInsertInstruction(VPInstruction *VPI) {
51 if (BB)
52 BB->insert(VPI, InsertPt);
53 return VPI;
54 }
55
56 VPInstruction *createInstruction(unsigned Opcode,
58 const Twine &Name = "") {
59 return tryInsertInstruction(new VPInstruction(Opcode, Operands, DL, Name));
60 }
61
62 VPInstruction *createInstruction(unsigned Opcode,
63 std::initializer_list<VPValue *> Operands,
64 DebugLoc DL, const Twine &Name = "") {
65 return createInstruction(Opcode, ArrayRef<VPValue *>(Operands), DL, Name);
66 }
67
68public:
69 VPBuilder() = default;
70 VPBuilder(VPBasicBlock *InsertBB) { setInsertPoint(InsertBB); }
71
72 /// Clear the insertion point: created instructions will not be inserted into
73 /// a block.
75 BB = nullptr;
76 InsertPt = VPBasicBlock::iterator();
77 }
78
79 VPBasicBlock *getInsertBlock() const { return BB; }
80 VPBasicBlock::iterator getInsertPoint() const { return InsertPt; }
81
82 /// Create a VPBuilder to insert after \p R.
85 B.setInsertPoint(R->getParent(), std::next(R->getIterator()));
86 return B;
87 }
88
89 /// InsertPoint - A saved insertion point.
91 VPBasicBlock *Block = nullptr;
93
94 public:
95 /// Creates a new insertion point which doesn't point to anything.
96 VPInsertPoint() = default;
97
98 /// Creates a new insertion point at the given location.
100 : Block(InsertBlock), Point(InsertPoint) {}
101
102 /// Returns true if this insert point is set.
103 bool isSet() const { return Block != nullptr; }
104
105 VPBasicBlock *getBlock() const { return Block; }
106 VPBasicBlock::iterator getPoint() const { return Point; }
107 };
108
109 /// Sets the current insert point to a previously-saved location.
111 if (IP.isSet())
112 setInsertPoint(IP.getBlock(), IP.getPoint());
113 else
115 }
116
117 /// This specifies that created VPInstructions should be appended to the end
118 /// of the specified block.
120 assert(TheBB && "Attempting to set a null insert point");
121 BB = TheBB;
122 InsertPt = BB->end();
123 }
124
125 /// This specifies that created instructions should be inserted at the
126 /// specified point.
128 BB = TheBB;
129 InsertPt = IP;
130 }
131
132 /// This specifies that created instructions should be inserted at the
133 /// specified point.
135 BB = IP->getParent();
136 InsertPt = IP->getIterator();
137 }
138
139 /// Create an N-ary operation with \p Opcode, \p Operands and set \p Inst as
140 /// its underlying Instruction.
142 Instruction *Inst = nullptr,
143 const Twine &Name = "") {
144 DebugLoc DL;
145 if (Inst)
146 DL = Inst->getDebugLoc();
147 VPInstruction *NewVPInst = createInstruction(Opcode, Operands, DL, Name);
148 NewVPInst->setUnderlyingValue(Inst);
149 return NewVPInst;
150 }
152 DebugLoc DL, const Twine &Name = "") {
153 return createInstruction(Opcode, Operands, DL, Name);
154 }
155
157 std::initializer_list<VPValue *> Operands,
159 DebugLoc DL = {}, const Twine &Name = "") {
160 return tryInsertInstruction(
161 new VPInstruction(Opcode, Operands, WrapFlags, DL, Name));
162 }
164 const Twine &Name = "") {
165 return createInstruction(VPInstruction::Not, {Operand}, DL, Name);
166 }
167
169 const Twine &Name = "") {
170 return createInstruction(Instruction::BinaryOps::And, {LHS, RHS}, DL, Name);
171 }
172
174 const Twine &Name = "") {
175 return createInstruction(Instruction::BinaryOps::Or, {LHS, RHS}, DL, Name);
176 }
177
179 DebugLoc DL = {}, const Twine &Name = "",
180 std::optional<FastMathFlags> FMFs = std::nullopt) {
181 auto *Select =
182 FMFs ? new VPInstruction(Instruction::Select, {Cond, TrueVal, FalseVal},
183 *FMFs, DL, Name)
184 : new VPInstruction(Instruction::Select, {Cond, TrueVal, FalseVal},
185 DL, Name);
186 return tryInsertInstruction(Select);
187 }
188
189 /// Create a new ICmp VPInstruction with predicate \p Pred and operands \p A
190 /// and \p B.
191 /// TODO: add createFCmp when needed.
192 VPValue *createICmp(CmpInst::Predicate Pred, VPValue *A, VPValue *B,
193 DebugLoc DL = {}, const Twine &Name = "");
194
195 //===--------------------------------------------------------------------===//
196 // RAII helpers.
197 //===--------------------------------------------------------------------===//
198
199 /// RAII object that stores the current insertion point and restores it when
200 /// the object is destroyed.
202 VPBuilder &Builder;
203 VPBasicBlock *Block;
205
206 public:
208 : Builder(B), Block(B.getInsertBlock()), Point(B.getInsertPoint()) {}
209
212
213 ~InsertPointGuard() { Builder.restoreIP(VPInsertPoint(Block, Point)); }
214 };
215};
216
217/// TODO: The following VectorizationFactor was pulled out of
218/// LoopVectorizationCostModel class. LV also deals with
219/// VectorizerParams::VectorizationFactor and VectorizationCostTy.
220/// We need to streamline them.
221
222/// Information about vectorization costs.
224 /// Vector width with best cost.
226
227 /// Cost of the loop with that width.
229
230 /// Cost of the scalar loop.
232
233 /// The minimum trip count required to make vectorization profitable, e.g. due
234 /// to runtime checks.
236
240
241 /// Width 1 means no vectorization, cost 0 means uncomputed cost.
243 return {ElementCount::getFixed(1), 0, 0};
244 }
245
246 bool operator==(const VectorizationFactor &rhs) const {
247 return Width == rhs.Width && Cost == rhs.Cost;
248 }
249
250 bool operator!=(const VectorizationFactor &rhs) const {
251 return !(*this == rhs);
252 }
253};
254
255/// ElementCountComparator creates a total ordering for ElementCount
256/// for the purposes of using it in a set structure.
258 bool operator()(const ElementCount &LHS, const ElementCount &RHS) const {
259 return std::make_tuple(LHS.isScalable(), LHS.getKnownMinValue()) <
260 std::make_tuple(RHS.isScalable(), RHS.getKnownMinValue());
261 }
262};
264
265/// A class that represents two vectorization factors (initialized with 0 by
266/// default). One for fixed-width vectorization and one for scalable
267/// vectorization. This can be used by the vectorizer to choose from a range of
268/// fixed and/or scalable VFs in order to find the most cost-effective VF to
269/// vectorize with.
273
275 : FixedVF(ElementCount::getFixed(0)),
276 ScalableVF(ElementCount::getScalable(0)) {}
278 *(Max.isScalable() ? &ScalableVF : &FixedVF) = Max;
279 }
284 "Invalid scalable properties");
285 }
286
288
289 /// \return true if either fixed- or scalable VF is non-zero.
290 explicit operator bool() const { return FixedVF || ScalableVF; }
291
292 /// \return true if either fixed- or scalable VF is a valid vector VF.
293 bool hasVector() const { return FixedVF.isVector() || ScalableVF.isVector(); }
294};
295
296/// Planner drives the vectorization process after having passed
297/// Legality checks.
299 /// The loop that we evaluate.
300 Loop *OrigLoop;
301
302 /// Loop Info analysis.
303 LoopInfo *LI;
304
305 /// The dominator tree.
306 DominatorTree *DT;
307
308 /// Target Library Info.
309 const TargetLibraryInfo *TLI;
310
311 /// Target Transform Info.
313
314 /// The legality analysis.
316
317 /// The profitability analysis.
319
320 /// The interleaved access analysis.
322
324
325 const LoopVectorizeHints &Hints;
326
328
330
331 /// Profitable vector factors.
333
334 /// A builder used to construct the current plan.
335 VPBuilder Builder;
336
337public:
339 Loop *L, LoopInfo *LI, DominatorTree *DT, const TargetLibraryInfo *TLI,
344 : OrigLoop(L), LI(LI), DT(DT), TLI(TLI), TTI(TTI), Legal(Legal), CM(CM),
345 IAI(IAI), PSE(PSE), Hints(Hints), ORE(ORE) {}
346
347 /// Plan how to best vectorize, return the best VF and its cost, or
348 /// std::nullopt if vectorization and interleaving should be avoided up front.
349 std::optional<VectorizationFactor> plan(ElementCount UserVF, unsigned UserIC);
350
351 /// Use the VPlan-native path to plan how to best vectorize, return the best
352 /// VF and its cost.
354
355 /// Return the best VPlan for \p VF.
357
358 /// Generate the IR code for the vectorized loop captured in VPlan \p BestPlan
359 /// according to the best selected \p VF and \p UF.
360 ///
361 /// TODO: \p IsEpilogueVectorization is needed to avoid issues due to epilogue
362 /// vectorization re-using plans for both the main and epilogue vector loops.
363 /// It should be removed once the re-use issue has been fixed.
364 /// \p ExpandedSCEVs is passed during execution of the plan for epilogue loop
365 /// to re-use expansion results generated during main plan execution.
366 ///
367 /// Returns a mapping of SCEVs to their expanded IR values and a mapping for
368 /// the reduction resume values. Note that this is a temporary workaround
369 /// needed due to the current epilogue handling.
370 std::pair<DenseMap<const SCEV *, Value *>,
372 executePlan(ElementCount VF, unsigned UF, VPlan &BestPlan,
374 bool IsEpilogueVectorization,
375 const DenseMap<const SCEV *, Value *> *ExpandedSCEVs = nullptr);
376
377#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
378 void printPlans(raw_ostream &O);
379#endif
380
381 /// Look through the existing plans and return true if we have one with
382 /// vectorization factor \p VF.
384 return any_of(VPlans,
385 [&](const VPlanPtr &Plan) { return Plan->hasVF(VF); });
386 }
387
388 /// Test a \p Predicate on a \p Range of VF's. Return the value of applying
389 /// \p Predicate on Range.Start, possibly decreasing Range.End such that the
390 /// returned value holds for the entire \p Range.
391 static bool
392 getDecisionAndClampRange(const std::function<bool(ElementCount)> &Predicate,
393 VFRange &Range);
394
395 /// \return The most profitable vectorization factor and the cost of that VF
396 /// for vectorizing the epilogue. Returns VectorizationFactor::Disabled if
397 /// epilogue vectorization is not supported for the loop.
399 selectEpilogueVectorizationFactor(const ElementCount MaxVF, unsigned IC);
400
401protected:
402 /// Build VPlans for power-of-2 VF's between \p MinVF and \p MaxVF inclusive,
403 /// according to the information gathered by Legal when it checked if it is
404 /// legal to vectorize the loop.
405 void buildVPlans(ElementCount MinVF, ElementCount MaxVF);
406
407private:
408 /// Build a VPlan according to the information gathered by Legal. \return a
409 /// VPlan for vectorization factors \p Range.Start and up to \p Range.End
410 /// exclusive, possibly decreasing \p Range.End.
411 VPlanPtr buildVPlan(VFRange &Range);
412
413 /// Build a VPlan using VPRecipes according to the information gather by
414 /// Legal. This method is only used for the legacy inner loop vectorizer.
415 /// \p Range's largest included VF is restricted to the maximum VF the
416 /// returned VPlan is valid for. If no VPlan can be built for the input range,
417 /// set the largest included VF to the maximum VF for which no plan could be
418 /// built.
419 VPlanPtr tryToBuildVPlanWithVPRecipes(VFRange &Range);
420
421 /// Build VPlans for power-of-2 VF's between \p MinVF and \p MaxVF inclusive,
422 /// according to the information gathered by Legal when it checked if it is
423 /// legal to vectorize the loop. This method creates VPlans using VPRecipes.
424 void buildVPlansWithVPRecipes(ElementCount MinVF, ElementCount MaxVF);
425
426 // Adjust the recipes for reductions. For in-loop reductions the chain of
427 // instructions leading from the loop exit instr to the phi need to be
428 // converted to reductions, with one operand being vector and the other being
429 // the scalar reduction chain. For other reductions, a select is introduced
430 // between the phi and live-out recipes when folding the tail.
431 void adjustRecipesForReductions(VPBasicBlock *LatchVPBB, VPlanPtr &Plan,
432 VPRecipeBuilder &RecipeBuilder,
433 ElementCount MinVF);
434
435 /// \return The most profitable vectorization factor and the cost of that VF.
436 /// This method checks every VF in \p CandidateVFs.
438 selectVectorizationFactor(const ElementCountSet &CandidateVFs);
439
440 /// Returns true if the per-lane cost of VectorizationFactor A is lower than
441 /// that of B.
442 bool isMoreProfitable(const VectorizationFactor &A,
443 const VectorizationFactor &B) const;
444
445 /// Determines if we have the infrastructure to vectorize the loop and its
446 /// epilogue, assuming the main loop is vectorized by \p VF.
447 bool isCandidateForEpilogueVectorization(const ElementCount VF) const;
448};
449
450} // namespace llvm
451
452#endif // LLVM_TRANSFORMS_VECTORIZE_LOOPVECTORIZATIONPLANNER_H
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
amdgpu AMDGPU Register Bank Select
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
std::string Name
This file defines an InstructionCost class that is used when calculating the cost of an instruction,...
mir Rename Register Operands
const SmallVectorImpl< MachineOperand > & Cond
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallSet class.
This file contains the declarations of the Vectorization Plan base classes:
Value * RHS
Value * LHS
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:41
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
Definition: InstrTypes.h:965
A debug info location.
Definition: DebugLoc.h:33
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
Definition: Dominators.h:162
constexpr bool isVector() const
One or more elements.
Definition: TypeSize.h:311
static constexpr ElementCount getFixed(ScalarTy MinVal)
Definition: TypeSize.h:296
InnerLoopVectorizer vectorizes loops which contain only one basic block to a specified vectorization ...
Drive the analysis of interleaved memory accesses in the loop.
Definition: VectorUtils.h:586
LoopVectorizationCostModel - estimates the expected speedups due to vectorization.
LoopVectorizationLegality checks if it is legal to vectorize a loop, and to what vectorization factor...
Planner drives the vectorization process after having passed Legality checks.
std::optional< VectorizationFactor > plan(ElementCount UserVF, unsigned UserIC)
Plan how to best vectorize, return the best VF and its cost, or std::nullopt if vectorization and int...
VectorizationFactor selectEpilogueVectorizationFactor(const ElementCount MaxVF, unsigned IC)
LoopVectorizationPlanner(Loop *L, LoopInfo *LI, DominatorTree *DT, const TargetLibraryInfo *TLI, const TargetTransformInfo &TTI, LoopVectorizationLegality *Legal, LoopVectorizationCostModel &CM, InterleavedAccessInfo &IAI, PredicatedScalarEvolution &PSE, const LoopVectorizeHints &Hints, OptimizationRemarkEmitter *ORE)
VectorizationFactor planInVPlanNativePath(ElementCount UserVF)
Use the VPlan-native path to plan how to best vectorize, return the best VF and its cost.
std::pair< DenseMap< const SCEV *, Value * >, DenseMap< const RecurrenceDescriptor *, Value * > > executePlan(ElementCount VF, unsigned UF, VPlan &BestPlan, InnerLoopVectorizer &LB, DominatorTree *DT, bool IsEpilogueVectorization, const DenseMap< const SCEV *, Value * > *ExpandedSCEVs=nullptr)
Generate the IR code for the vectorized loop captured in VPlan BestPlan according to the best selecte...
void buildVPlans(ElementCount MinVF, ElementCount MaxVF)
Build VPlans for power-of-2 VF's between MinVF and MaxVF inclusive, according to the information gath...
VPlan & getBestPlanFor(ElementCount VF) const
Return the best VPlan for VF.
static bool getDecisionAndClampRange(const std::function< bool(ElementCount)> &Predicate, VFRange &Range)
Test a Predicate on a Range of VF's.
void printPlans(raw_ostream &O)
bool hasPlanWithVF(ElementCount VF) const
Look through the existing plans and return true if we have one with vectorization factor VF.
Utility class for getting and setting loop vectorizer hints in the form of loop metadata.
Represents a single loop in the control flow graph.
Definition: LoopInfo.h:44
The optimization diagnostic interface.
An interface layer with SCEV used to manage how we see SCEV expressions for values in the context of ...
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
Definition: SmallSet.h:135
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1209
Provides information about what library functions are available for the current target.
This pass provides access to the codegen interfaces that are needed for IR-level transformations.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:81
VPBasicBlock serves as the leaf of the Hierarchical Control-Flow Graph.
Definition: VPlan.h:2594
RecipeListTy::iterator iterator
Instruction iterators...
Definition: VPlan.h:2615
iterator end()
Definition: VPlan.h:2625
void insert(VPRecipeBase *Recipe, iterator InsertPt)
Definition: VPlan.h:2653
RAII object that stores the current insertion point and restores it when the object is destroyed.
InsertPointGuard(const InsertPointGuard &)=delete
InsertPointGuard & operator=(const InsertPointGuard &)=delete
InsertPoint - A saved insertion point.
VPInsertPoint(VPBasicBlock *InsertBlock, VPBasicBlock::iterator InsertPoint)
Creates a new insertion point at the given location.
VPBasicBlock::iterator getPoint() const
VPInsertPoint()=default
Creates a new insertion point which doesn't point to anything.
bool isSet() const
Returns true if this insert point is set.
VPlan-based builder utility analogous to IRBuilder.
void setInsertPoint(VPBasicBlock *TheBB, VPBasicBlock::iterator IP)
This specifies that created instructions should be inserted at the specified point.
void setInsertPoint(VPRecipeBase *IP)
This specifies that created instructions should be inserted at the specified point.
void restoreIP(VPInsertPoint IP)
Sets the current insert point to a previously-saved location.
VPValue * createOr(VPValue *LHS, VPValue *RHS, DebugLoc DL={}, const Twine &Name="")
VPBasicBlock * getInsertBlock() const
VPBasicBlock::iterator getInsertPoint() const
VPBuilder(VPBasicBlock *InsertBB)
static VPBuilder getToInsertAfter(VPRecipeBase *R)
Create a VPBuilder to insert after R.
VPInstruction * createNaryOp(unsigned Opcode, ArrayRef< VPValue * > Operands, DebugLoc DL, const Twine &Name="")
VPValue * createICmp(CmpInst::Predicate Pred, VPValue *A, VPValue *B, DebugLoc DL={}, const Twine &Name="")
Create a new ICmp VPInstruction with predicate Pred and operands A and B.
VPInstruction * createOverflowingOp(unsigned Opcode, std::initializer_list< VPValue * > Operands, VPRecipeWithIRFlags::WrapFlagsTy WrapFlags, DebugLoc DL={}, const Twine &Name="")
VPValue * createAnd(VPValue *LHS, VPValue *RHS, DebugLoc DL={}, const Twine &Name="")
void clearInsertionPoint()
Clear the insertion point: created instructions will not be inserted into a block.
VPInstruction * createNaryOp(unsigned Opcode, ArrayRef< VPValue * > Operands, Instruction *Inst=nullptr, const Twine &Name="")
Create an N-ary operation with Opcode, Operands and set Inst as its underlying Instruction.
VPValue * createNot(VPValue *Operand, DebugLoc DL={}, const Twine &Name="")
VPBuilder()=default
VPValue * createSelect(VPValue *Cond, VPValue *TrueVal, VPValue *FalseVal, DebugLoc DL={}, const Twine &Name="", std::optional< FastMathFlags > FMFs=std::nullopt)
void setInsertPoint(VPBasicBlock *TheBB)
This specifies that created VPInstructions should be appended to the end of the specified block.
This is a concrete Recipe that models a single VPlan-level instruction.
Definition: VPlan.h:1139
VPRecipeBase is a base class modeling a sequence of one or more output IR instructions.
Definition: VPlan.h:713
VPBasicBlock * getParent()
Definition: VPlan.h:738
Helper class to create VPRecipies from IR instructions.
void setUnderlyingValue(Value *Val)
Definition: VPlanValue.h:191
VPlan models a candidate for vectorization, encoding various decisions take to produce efficient outp...
Definition: VPlan.h:2828
constexpr bool isScalable() const
Returns whether the quantity is scaled by a runtime quantity (vscale).
Definition: TypeSize.h:171
self_iterator getIterator()
Definition: ilist_node.h:109
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1738
std::unique_ptr< VPlan > VPlanPtr
Definition: VPlan.h:134
ElementCountComparator creates a total ordering for ElementCount for the purposes of using it in a se...
bool operator()(const ElementCount &LHS, const ElementCount &RHS) const
A class that represents two vectorization factors (initialized with 0 by default).
FixedScalableVFPair(const ElementCount &FixedVF, const ElementCount &ScalableVF)
FixedScalableVFPair(const ElementCount &Max)
static FixedScalableVFPair getNone()
A range of powers-of-2 vectorization factors with fixed start and adjustable end.
Definition: VPlan.h:87
TODO: The following VectorizationFactor was pulled out of LoopVectorizationCostModel class.
InstructionCost Cost
Cost of the loop with that width.
ElementCount MinProfitableTripCount
The minimum trip count required to make vectorization profitable, e.g.
bool operator==(const VectorizationFactor &rhs) const
ElementCount Width
Vector width with best cost.
InstructionCost ScalarCost
Cost of the scalar loop.
bool operator!=(const VectorizationFactor &rhs) const
static VectorizationFactor Disabled()
Width 1 means no vectorization, cost 0 means uncomputed cost.
VectorizationFactor(ElementCount Width, InstructionCost Cost, InstructionCost ScalarCost)