LLVM 18.0.0git
VPlanValue.h
Go to the documentation of this file.
1//===- VPlanValue.h - Represent Values in Vectorizer Plan -----------------===//
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 contains the declarations of the entities induced by Vectorization
11/// Plans, e.g. the instructions the VPlan intends to generate if executed.
12/// VPlan models the following entities:
13/// VPValue VPUser VPDef
14/// | |
15/// VPInstruction
16/// These are documented in docs/VectorizationPlan.rst.
17///
18//===----------------------------------------------------------------------===//
19
20#ifndef LLVM_TRANSFORMS_VECTORIZE_VPLAN_VALUE_H
21#define LLVM_TRANSFORMS_VECTORIZE_VPLAN_VALUE_H
22
23#include "llvm/ADT/DenseMap.h"
24#include "llvm/ADT/STLExtras.h"
28
29namespace llvm {
30
31// Forward declarations.
32class raw_ostream;
33class Value;
34class VPDef;
35class VPSlotTracker;
36class VPUser;
37class VPRecipeBase;
38class VPWidenMemoryInstructionRecipe;
39
40// This is the base class of the VPlan Def/Use graph, used for modeling the data
41// flow into, within and out of the VPlan. VPValues can stand for live-ins
42// coming from the input IR, instructions which VPlan will generate if executed
43// and live-outs which the VPlan will need to fix accordingly.
44class VPValue {
45 friend class VPBuilder;
46 friend class VPDef;
47 friend class VPInstruction;
48 friend struct VPlanTransforms;
49 friend class VPBasicBlock;
51 friend class VPSlotTracker;
52 friend class VPRecipeBase;
54
55 const unsigned char SubclassID; ///< Subclass identifier (for isa/dyn_cast).
56
58
59protected:
60 // Hold the underlying Value, if any, attached to this VPValue.
62
63 /// Pointer to the VPDef that defines this VPValue. If it is nullptr, the
64 /// VPValue is not defined by any recipe modeled in VPlan.
66
67 VPValue(const unsigned char SC, Value *UV = nullptr, VPDef *Def = nullptr);
68
69 // DESIGN PRINCIPLE: Access to the underlying IR must be strictly limited to
70 // the front-end and back-end of VPlan so that the middle-end is as
71 // independent as possible of the underlying IR. We grant access to the
72 // underlying IR using friendship. In that way, we should be able to use VPlan
73 // for multiple underlying IRs (Polly?) by providing a new VPlan front-end,
74 // back-end and analysis information for the new IR.
75
76 // Set \p Val as the underlying Value of this VPValue.
78 assert(!UnderlyingVal && "Underlying Value is already set.");
79 UnderlyingVal = Val;
80 }
81
82public:
83 /// Return the underlying Value attached to this VPValue.
85 const Value *getUnderlyingValue() const { return UnderlyingVal; }
86
87 /// An enumeration for keeping track of the concrete subclass of VPValue that
88 /// are actually instantiated.
89 enum {
90 VPValueSC, /// A generic VPValue, like live-in values or defined by a recipe
91 /// that defines multiple values.
92 VPVRecipeSC /// A VPValue sub-class that is a VPRecipeBase.
93 };
94
95 /// Create a live-in VPValue.
96 VPValue(Value *UV = nullptr) : VPValue(VPValueSC, UV, nullptr) {}
97 /// Create a VPValue for a \p Def which is a subclass of VPValue.
98 VPValue(VPDef *Def, Value *UV = nullptr) : VPValue(VPVRecipeSC, UV, Def) {}
99 /// Create a VPValue for a \p Def which defines multiple values.
101 VPValue(const VPValue &) = delete;
102 VPValue &operator=(const VPValue &) = delete;
103
104 virtual ~VPValue();
105
106 /// \return an ID for the concrete type of this object.
107 /// This is used to implement the classof checks. This should not be used
108 /// for any other purpose, as the values may change as LLVM evolves.
109 unsigned getVPValueID() const { return SubclassID; }
110
111#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
112 void printAsOperand(raw_ostream &OS, VPSlotTracker &Tracker) const;
113 void print(raw_ostream &OS, VPSlotTracker &Tracker) const;
114
115 /// Dump the value to stderr (for debugging).
116 void dump() const;
117#endif
118
119 unsigned getNumUsers() const { return Users.size(); }
120 void addUser(VPUser &User) { Users.push_back(&User); }
121
122 /// Remove a single \p User from the list of users.
124 bool Found = false;
125 // The same user can be added multiple times, e.g. because the same VPValue
126 // is used twice by the same VPUser. Remove a single one.
127 erase_if(Users, [&User, &Found](VPUser *Other) {
128 if (Found)
129 return false;
130 if (Other == &User) {
131 Found = true;
132 return true;
133 }
134 return false;
135 });
136 }
137
142
143 user_iterator user_begin() { return Users.begin(); }
144 const_user_iterator user_begin() const { return Users.begin(); }
145 user_iterator user_end() { return Users.end(); }
146 const_user_iterator user_end() const { return Users.end(); }
150 }
151
152 /// Returns true if the value has more than one unique user.
154 if (getNumUsers() == 0)
155 return false;
156
157 // Check if all users match the first user.
158 auto Current = std::next(user_begin());
159 while (Current != user_end() && *user_begin() == *Current)
160 Current++;
161 return Current != user_end();
162 }
163
164 void replaceAllUsesWith(VPValue *New);
165
166 /// Returns the recipe defining this VPValue or nullptr if it is not defined
167 /// by a recipe, i.e. is a live-in.
169 const VPRecipeBase *getDefiningRecipe() const;
170
171 /// Returns true if this VPValue is defined by a recipe.
172 bool hasDefiningRecipe() const { return getDefiningRecipe(); }
173
174 /// Returns true if this VPValue is a live-in, i.e. defined outside the VPlan.
175 bool isLiveIn() const { return !hasDefiningRecipe(); }
176
177 /// Returns the underlying IR value, if this VPValue is defined outside the
178 /// scope of VPlan. Returns nullptr if the VPValue is defined by a VPDef
179 /// inside a VPlan.
181 assert(isLiveIn() &&
182 "VPValue is not a live-in; it is defined by a VPDef inside a VPlan");
183 return getUnderlyingValue();
184 }
185 const Value *getLiveInIRValue() const {
186 assert(isLiveIn() &&
187 "VPValue is not a live-in; it is defined by a VPDef inside a VPlan");
188 return getUnderlyingValue();
189 }
190
191 /// Returns true if the VPValue is defined outside any vector regions, i.e. it
192 /// is a live-in value.
193 /// TODO: Also handle recipes defined in pre-header blocks.
195};
196
199
201
202/// This class augments VPValue with operands which provide the inverse def-use
203/// edges from VPValue's users to their defs.
204class VPUser {
205public:
206 /// Subclass identifier (for isa/dyn_cast).
207 enum class VPUserID {
208 Recipe,
209 LiveOut,
210 };
211
212private:
214
215 VPUserID ID;
216
217protected:
218#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
219 /// Print the operands to \p O.
221#endif
222
224 for (VPValue *Operand : Operands)
225 addOperand(Operand);
226 }
227
228 VPUser(std::initializer_list<VPValue *> Operands, VPUserID ID)
230
231 template <typename IterT>
233 for (VPValue *Operand : Operands)
234 addOperand(Operand);
235 }
236
237public:
238 VPUser() = delete;
239 VPUser(const VPUser &) = delete;
240 VPUser &operator=(const VPUser &) = delete;
241 virtual ~VPUser() {
242 for (VPValue *Op : operands())
243 Op->removeUser(*this);
244 }
245
246 VPUserID getVPUserID() const { return ID; }
247
248 void addOperand(VPValue *Operand) {
249 Operands.push_back(Operand);
250 Operand->addUser(*this);
251 }
252
253 unsigned getNumOperands() const { return Operands.size(); }
254 inline VPValue *getOperand(unsigned N) const {
255 assert(N < Operands.size() && "Operand index out of bounds");
256 return Operands[N];
257 }
258
259 void setOperand(unsigned I, VPValue *New) {
260 Operands[I]->removeUser(*this);
261 Operands[I] = New;
262 New->addUser(*this);
263 }
264
266 VPValue *Op = Operands.pop_back_val();
267 Op->removeUser(*this);
268 }
269
274
275 operand_iterator op_begin() { return Operands.begin(); }
276 const_operand_iterator op_begin() const { return Operands.begin(); }
277 operand_iterator op_end() { return Operands.end(); }
278 const_operand_iterator op_end() const { return Operands.end(); }
282 }
283
284 /// Returns true if the VPUser uses scalars of operand \p Op. Conservatively
285 /// returns if only first (scalar) lane is used, as default.
286 virtual bool usesScalars(const VPValue *Op) const {
288 "Op must be an operand of the recipe");
289 return onlyFirstLaneUsed(Op);
290 }
291
292 /// Returns true if the VPUser only uses the first lane of operand \p Op.
293 /// Conservatively returns false.
294 virtual bool onlyFirstLaneUsed(const VPValue *Op) const {
296 "Op must be an operand of the recipe");
297 return false;
298 }
299};
300
301/// This class augments a recipe with a set of VPValues defined by the recipe.
302/// It allows recipes to define zero, one or multiple VPValues. A VPDef owns
303/// the VPValues it defines and is responsible for deleting its defined values.
304/// Single-value VPDefs that also inherit from VPValue must make sure to inherit
305/// from VPDef before VPValue.
306class VPDef {
307 friend class VPValue;
308
309 /// Subclass identifier (for isa/dyn_cast).
310 const unsigned char SubclassID;
311
312 /// The VPValues defined by this VPDef.
313 TinyPtrVector<VPValue *> DefinedValues;
314
315 /// Add \p V as a defined value by this VPDef.
316 void addDefinedValue(VPValue *V) {
317 assert(V->Def == this &&
318 "can only add VPValue already linked with this VPDef");
319 DefinedValues.push_back(V);
320 }
321
322 /// Remove \p V from the values defined by this VPDef. \p V must be a defined
323 /// value of this VPDef.
324 void removeDefinedValue(VPValue *V) {
325 assert(V->Def == this && "can only remove VPValue linked with this VPDef");
326 assert(is_contained(DefinedValues, V) &&
327 "VPValue to remove must be in DefinedValues");
328 erase_value(DefinedValues, V);
329 V->Def = nullptr;
330 }
331
332public:
333 /// An enumeration for keeping track of the concrete subclass of VPRecipeBase
334 /// that is actually instantiated. Values of this enumeration are kept in the
335 /// SubclassID field of the VPRecipeBase objects. They are used for concrete
336 /// type identification.
337 using VPRecipeTy = enum {
338 VPBranchOnMaskSC,
339 VPDerivedIVSC,
340 VPExpandSCEVSC,
341 VPInstructionSC,
342 VPInterleaveSC,
343 VPReductionSC,
344 VPReplicateSC,
345 VPScalarIVStepsSC,
346 VPWidenCallSC,
347 VPWidenCanonicalIVSC,
348 VPWidenCastSC,
349 VPWidenGEPSC,
350 VPWidenMemoryInstructionSC,
351 VPWidenSC,
352 VPWidenSelectSC,
353 // START: Phi-like recipes. Need to be kept together.
354 VPBlendSC,
355 VPPredInstPHISC,
356 // START: SubclassID for recipes that inherit VPHeaderPHIRecipe.
357 // VPHeaderPHIRecipe need to be kept together.
358 VPCanonicalIVPHISC,
359 VPActiveLaneMaskPHISC,
360 VPFirstOrderRecurrencePHISC,
361 VPWidenPHISC,
362 VPWidenIntOrFpInductionSC,
363 VPWidenPointerInductionSC,
364 VPReductionPHISC,
365 // END: SubclassID for recipes that inherit VPHeaderPHIRecipe
366 // END: Phi-like recipes
367 VPFirstPHISC = VPBlendSC,
368 VPFirstHeaderPHISC = VPCanonicalIVPHISC,
369 VPLastHeaderPHISC = VPReductionPHISC,
370 VPLastPHISC = VPReductionPHISC,
371 };
372
373 VPDef(const unsigned char SC) : SubclassID(SC) {}
374
375 virtual ~VPDef() {
376 for (VPValue *D : make_early_inc_range(DefinedValues)) {
377 assert(D->Def == this &&
378 "all defined VPValues should point to the containing VPDef");
379 assert(D->getNumUsers() == 0 &&
380 "all defined VPValues should have no more users");
381 D->Def = nullptr;
382 delete D;
383 }
384 }
385
386 /// Returns the only VPValue defined by the VPDef. Can only be called for
387 /// VPDefs with a single defined value.
389 assert(DefinedValues.size() == 1 && "must have exactly one defined value");
390 assert(DefinedValues[0] && "defined value must be non-null");
391 return DefinedValues[0];
392 }
393 const VPValue *getVPSingleValue() const {
394 assert(DefinedValues.size() == 1 && "must have exactly one defined value");
395 assert(DefinedValues[0] && "defined value must be non-null");
396 return DefinedValues[0];
397 }
398
399 /// Returns the VPValue with index \p I defined by the VPDef.
400 VPValue *getVPValue(unsigned I) {
401 assert(DefinedValues[I] && "defined value must be non-null");
402 return DefinedValues[I];
403 }
404 const VPValue *getVPValue(unsigned I) const {
405 assert(DefinedValues[I] && "defined value must be non-null");
406 return DefinedValues[I];
407 }
408
409 /// Returns an ArrayRef of the values defined by the VPDef.
410 ArrayRef<VPValue *> definedValues() { return DefinedValues; }
411 /// Returns an ArrayRef of the values defined by the VPDef.
412 ArrayRef<VPValue *> definedValues() const { return DefinedValues; }
413
414 /// Returns the number of values defined by the VPDef.
415 unsigned getNumDefinedValues() const { return DefinedValues.size(); }
416
417 /// \return an ID for the concrete type of this object.
418 /// This is used to implement the classof checks. This should not be used
419 /// for any other purpose, as the values may change as LLVM evolves.
420 unsigned getVPDefID() const { return SubclassID; }
421
422#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
423 /// Dump the VPDef to stderr (for debugging).
424 void dump() const;
425
426 /// Each concrete VPDef prints itself.
427 virtual void print(raw_ostream &O, const Twine &Indent,
428 VPSlotTracker &SlotTracker) const = 0;
429#endif
430};
431
432class VPlan;
433class VPBasicBlock;
434
435/// This class can be used to assign consecutive numbers to all VPValues in a
436/// VPlan and allows querying the numbering for printing, similar to the
437/// ModuleSlotTracker for IR values.
440 unsigned NextSlot = 0;
441
442 void assignSlot(const VPValue *V);
443 void assignSlots(const VPlan &Plan);
444 void assignSlots(const VPBasicBlock *VPBB);
445
446public:
447 VPSlotTracker(const VPlan *Plan = nullptr) {
448 if (Plan)
449 assignSlots(*Plan);
450 }
451
452 unsigned getSlot(const VPValue *V) const {
453 auto I = Slots.find(V);
454 if (I == Slots.end())
455 return -1;
456 return I->second;
457 }
458};
459
460} // namespace llvm
461
462#endif // LLVM_TRANSFORMS_VECTORIZE_VPLAN_VALUE_H
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
This file defines the DenseMap class.
iv Induction Variable Users
Definition: IVUsers.cpp:48
#define I(x, y, z)
Definition: MD5.cpp:58
mir Rename Register Operands
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file contains some templates that are useful if you are working with the STL at all.
raw_pwrite_stream & OS
This file defines the SmallVector class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:41
This class represents an Operation in the Expression.
iterator find(const_arg_type_t< KeyT > Val)
Definition: DenseMap.h:155
iterator end()
Definition: DenseMap.h:84
This class provides computation of slot numbers for LLVM Assembly writing.
Definition: AsmWriter.cpp:677
typename SuperClass::const_iterator const_iterator
Definition: SmallVector.h:582
typename SuperClass::iterator iterator
Definition: SmallVector.h:581
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1200
TinyPtrVector - This class is specialized for cases where there are normally 0 or 1 element in a vect...
Definition: TinyPtrVector.h:29
void push_back(EltTy NewVal)
unsigned size() const
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:2253
VPlan-based builder utility analogous to IRBuilder.
This class augments a recipe with a set of VPValues defined by the recipe.
Definition: VPlanValue.h:306
void dump() const
Dump the VPDef to stderr (for debugging).
Definition: VPlan.cpp:108
unsigned getNumDefinedValues() const
Returns the number of values defined by the VPDef.
Definition: VPlanValue.h:415
virtual ~VPDef()
Definition: VPlanValue.h:375
ArrayRef< VPValue * > definedValues()
Returns an ArrayRef of the values defined by the VPDef.
Definition: VPlanValue.h:410
VPValue * getVPSingleValue()
Returns the only VPValue defined by the VPDef.
Definition: VPlanValue.h:388
const VPValue * getVPSingleValue() const
Definition: VPlanValue.h:393
ArrayRef< VPValue * > definedValues() const
Returns an ArrayRef of the values defined by the VPDef.
Definition: VPlanValue.h:412
virtual void print(raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const =0
Each concrete VPDef prints itself.
VPValue * getVPValue(unsigned I)
Returns the VPValue with index I defined by the VPDef.
Definition: VPlanValue.h:400
enum { VPBranchOnMaskSC, VPDerivedIVSC, VPExpandSCEVSC, VPInstructionSC, VPInterleaveSC, VPReductionSC, VPReplicateSC, VPScalarIVStepsSC, VPWidenCallSC, VPWidenCanonicalIVSC, VPWidenCastSC, VPWidenGEPSC, VPWidenMemoryInstructionSC, VPWidenSC, VPWidenSelectSC, VPBlendSC, VPPredInstPHISC, VPCanonicalIVPHISC, VPActiveLaneMaskPHISC, VPFirstOrderRecurrencePHISC, VPWidenPHISC, VPWidenIntOrFpInductionSC, VPWidenPointerInductionSC, VPReductionPHISC, VPFirstPHISC=VPBlendSC, VPFirstHeaderPHISC=VPCanonicalIVPHISC, VPLastHeaderPHISC=VPReductionPHISC, VPLastPHISC=VPReductionPHISC, } VPRecipeTy
An enumeration for keeping track of the concrete subclass of VPRecipeBase that is actually instantiat...
Definition: VPlanValue.h:371
unsigned getVPDefID() const
Definition: VPlanValue.h:420
VPDef(const unsigned char SC)
Definition: VPlanValue.h:373
const VPValue * getVPValue(unsigned I) const
Definition: VPlanValue.h:404
This is a concrete Recipe that models a single VPlan-level instruction.
Definition: VPlan.h:1018
VPRecipeBase is a base class modeling a sequence of one or more output IR instructions.
Definition: VPlan.h:707
This class can be used to assign consecutive numbers to all VPValues in a VPlan and allows querying t...
Definition: VPlanValue.h:438
unsigned getSlot(const VPValue *V) const
Definition: VPlanValue.h:452
VPSlotTracker(const VPlan *Plan=nullptr)
Definition: VPlanValue.h:447
This class augments VPValue with operands which provide the inverse def-use edges from VPValue's user...
Definition: VPlanValue.h:204
void printOperands(raw_ostream &O, VPSlotTracker &SlotTracker) const
Print the operands to O.
Definition: VPlan.cpp:1140
void removeLastOperand()
Definition: VPlanValue.h:265
operand_range operands()
Definition: VPlanValue.h:279
void setOperand(unsigned I, VPValue *New)
Definition: VPlanValue.h:259
VPUser & operator=(const VPUser &)=delete
unsigned getNumOperands() const
Definition: VPlanValue.h:253
SmallVectorImpl< VPValue * >::const_iterator const_operand_iterator
Definition: VPlanValue.h:271
VPUser(ArrayRef< VPValue * > Operands, VPUserID ID)
Definition: VPlanValue.h:223
const_operand_iterator op_begin() const
Definition: VPlanValue.h:276
operand_iterator op_end()
Definition: VPlanValue.h:277
const_operand_range operands() const
Definition: VPlanValue.h:280
operand_iterator op_begin()
Definition: VPlanValue.h:275
VPValue * getOperand(unsigned N) const
Definition: VPlanValue.h:254
VPUser(const VPUser &)=delete
VPUser()=delete
virtual bool onlyFirstLaneUsed(const VPValue *Op) const
Returns true if the VPUser only uses the first lane of operand Op.
Definition: VPlanValue.h:294
VPUserID
Subclass identifier (for isa/dyn_cast).
Definition: VPlanValue.h:207
iterator_range< const_operand_iterator > const_operand_range
Definition: VPlanValue.h:273
VPUser(iterator_range< IterT > Operands, VPUserID ID)
Definition: VPlanValue.h:232
SmallVectorImpl< VPValue * >::iterator operand_iterator
Definition: VPlanValue.h:270
virtual ~VPUser()
Definition: VPlanValue.h:241
const_operand_iterator op_end() const
Definition: VPlanValue.h:278
virtual bool usesScalars(const VPValue *Op) const
Returns true if the VPUser uses scalars of operand Op.
Definition: VPlanValue.h:286
iterator_range< operand_iterator > operand_range
Definition: VPlanValue.h:272
void addOperand(VPValue *Operand)
Definition: VPlanValue.h:248
VPUser(std::initializer_list< VPValue * > Operands, VPUserID ID)
Definition: VPlanValue.h:228
VPUserID getVPUserID() const
Definition: VPlanValue.h:246
bool hasDefiningRecipe() const
Returns true if this VPValue is defined by a recipe.
Definition: VPlanValue.h:172
VPValue(Value *UV=nullptr)
Create a live-in VPValue.
Definition: VPlanValue.h:96
Value * getUnderlyingValue()
Return the underlying Value attached to this VPValue.
Definition: VPlanValue.h:84
bool hasMoreThanOneUniqueUser()
Returns true if the value has more than one unique user.
Definition: VPlanValue.h:153
unsigned getVPValueID() const
Definition: VPlanValue.h:109
VPRecipeBase * getDefiningRecipe()
Returns the recipe defining this VPValue or nullptr if it is not defined by a recipe,...
Definition: VPlan.cpp:117
void printAsOperand(raw_ostream &OS, VPSlotTracker &Tracker) const
Definition: VPlan.cpp:1125
void removeUser(VPUser &User)
Remove a single User from the list of users.
Definition: VPlanValue.h:123
SmallVectorImpl< VPUser * >::const_iterator const_user_iterator
Definition: VPlanValue.h:139
const_user_iterator user_begin() const
Definition: VPlanValue.h:144
const Value * getLiveInIRValue() const
Definition: VPlanValue.h:185
void addUser(VPUser &User)
Definition: VPlanValue.h:120
@ VPVRecipeSC
A generic VPValue, like live-in values or defined by a recipe that defines multiple values.
Definition: VPlanValue.h:92
Value * UnderlyingVal
Definition: VPlanValue.h:61
VPValue(Value *UV, VPDef *Def)
Create a VPValue for a Def which defines multiple values.
Definition: VPlanValue.h:100
const_user_range users() const
Definition: VPlanValue.h:148
VPValue(const VPValue &)=delete
VPValue & operator=(const VPValue &)=delete
void dump() const
Dump the value to stderr (for debugging).
Definition: VPlan.cpp:100
void setUnderlyingValue(Value *Val)
Definition: VPlanValue.h:77
virtual ~VPValue()
Definition: VPlan.cpp:86
SmallVectorImpl< VPUser * >::iterator user_iterator
Definition: VPlanValue.h:138
iterator_range< user_iterator > user_range
Definition: VPlanValue.h:140
const_user_iterator user_end() const
Definition: VPlanValue.h:146
void print(raw_ostream &OS, VPSlotTracker &Tracker) const
Definition: VPlan.cpp:93
void replaceAllUsesWith(VPValue *New)
Definition: VPlan.cpp:1109
VPValue(VPDef *Def, Value *UV=nullptr)
Create a VPValue for a Def which is a subclass of VPValue.
Definition: VPlanValue.h:98
user_iterator user_begin()
Definition: VPlanValue.h:143
unsigned getNumUsers() const
Definition: VPlanValue.h:119
Value * getLiveInIRValue()
Returns the underlying IR value, if this VPValue is defined outside the scope of VPlan.
Definition: VPlanValue.h:180
const Value * getUnderlyingValue() const
Definition: VPlanValue.h:85
user_iterator user_end()
Definition: VPlanValue.h:145
bool isLiveIn() const
Returns true if this VPValue is a live-in, i.e. defined outside the VPlan.
Definition: VPlanValue.h:175
user_range users()
Definition: VPlanValue.h:147
VPDef * Def
Pointer to the VPDef that defines this VPValue.
Definition: VPlanValue.h:65
iterator_range< const_user_iterator > const_user_range
Definition: VPlanValue.h:141
bool isDefinedOutsideVectorRegions() const
Returns true if the VPValue is defined outside any vector regions, i.e.
Definition: VPlanValue.h:194
A Recipe for widening load/store operations.
Definition: VPlan.h:1938
VPlan models a candidate for vectorization, encoding various decisions take to produce efficient outp...
Definition: VPlan.h:2474
LLVM Value Representation.
Definition: Value.h:74
A range adaptor for a pair of iterators.
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
This provides a very simple, boring adaptor for a begin and end iterator into a range type.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
iterator_range< early_inc_iterator_impl< detail::IterOfRange< RangeT > > > make_early_inc_range(RangeT &&Range)
Make a range that does early increment to allow mutation of the underlying range without disrupting i...
Definition: STLExtras.h:666
DenseMap< VPValue *, Value * > VPValue2ValueTy
Definition: VPlanValue.h:198
@ Other
Any other memory.
void erase_value(Container &C, ValueType V)
Wrapper function to remove a value from a container:
Definition: STLExtras.h:2029
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
Definition: APFixedPoint.h:292
void erase_if(Container &C, UnaryPredicate P)
Provide a container algorithm similar to C++ Library Fundamentals v2's erase_if which is equivalent t...
Definition: STLExtras.h:2021
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
Definition: STLExtras.h:1884
DenseMap< Value *, VPValue * > Value2VPValueTy
Definition: VPlanValue.h:197
#define N