LLVM 22.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"
26#include "llvm/ADT/StringMap.h"
30
31namespace llvm {
32
33// Forward declarations.
34class raw_ostream;
35class Value;
36class VPDef;
37struct VPDoubleValueDef;
38class VPSlotTracker;
39class VPUser;
40class VPRecipeBase;
42class VPPhiAccessors;
43
44// This is the base class of the VPlan Def/Use graph, used for modeling the data
45// flow into, within and out of the VPlan. VPValues can stand for live-ins
46// coming from the input IR and instructions which VPlan will generate if
47// executed.
49 friend class VPDef;
50 friend struct VPDoubleValueDef;
51 friend class VPInterleaveBase;
52 friend class VPlan;
53 friend class VPExpressionRecipe;
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 /// Create a live-in VPValue.
70 VPValue(Value *UV = nullptr) : VPValue(VPValueSC, UV, nullptr) {}
71 /// Create a VPValue for a \p Def which is a subclass of VPValue.
72 VPValue(VPDef *Def, Value *UV = nullptr) : VPValue(VPVRecipeSC, UV, Def) {}
73 /// Create a VPValue for a \p Def which defines multiple values.
75
76 // DESIGN PRINCIPLE: Access to the underlying IR must be strictly limited to
77 // the front-end and back-end of VPlan so that the middle-end is as
78 // independent as possible of the underlying IR. We grant access to the
79 // underlying IR using friendship. In that way, we should be able to use VPlan
80 // for multiple underlying IRs (Polly?) by providing a new VPlan front-end,
81 // back-end and analysis information for the new IR.
82
83public:
84 /// Return the underlying Value attached to this VPValue.
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 VPValue(const VPValue &) = delete;
96 VPValue &operator=(const VPValue &) = delete;
97
98 virtual ~VPValue();
99
100 /// \return an ID for the concrete type of this object.
101 /// This is used to implement the classof checks. This should not be used
102 /// for any other purpose, as the values may change as LLVM evolves.
103 unsigned getVPValueID() const { return SubclassID; }
104
105#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
106 void printAsOperand(raw_ostream &OS, VPSlotTracker &Tracker) const;
107 void print(raw_ostream &OS, VPSlotTracker &Tracker) const;
108
109 /// Dump the value to stderr (for debugging).
110 void dump() const;
111#endif
112
113 unsigned getNumUsers() const { return Users.size(); }
114 void addUser(VPUser &User) { Users.push_back(&User); }
115
116 /// Remove a single \p User from the list of users.
118 // The same user can be added multiple times, e.g. because the same VPValue
119 // is used twice by the same VPUser. Remove a single one.
120 auto *I = find(Users, &User);
121 if (I != Users.end())
122 Users.erase(I);
123 }
124
129
130 user_iterator user_begin() { return Users.begin(); }
131 const_user_iterator user_begin() const { return Users.begin(); }
132 user_iterator user_end() { return Users.end(); }
133 const_user_iterator user_end() const { return Users.end(); }
137 }
138
139 /// Returns true if the value has more than one unique user.
141 if (getNumUsers() == 0)
142 return false;
143
144 // Check if all users match the first user.
145 auto Current = std::next(user_begin());
146 while (Current != user_end() && *user_begin() == *Current)
147 Current++;
148 return Current != user_end();
149 }
150
151 bool hasOneUse() const { return getNumUsers() == 1; }
152
153 void replaceAllUsesWith(VPValue *New);
154
155 /// Go through the uses list for this VPValue and make each use point to \p
156 /// New if the callback ShouldReplace returns true for the given use specified
157 /// by a pair of (VPUser, the use index).
158 void replaceUsesWithIf(
159 VPValue *New,
160 llvm::function_ref<bool(VPUser &U, unsigned Idx)> ShouldReplace);
161
162 /// Returns the recipe defining this VPValue or nullptr if it is not defined
163 /// by a recipe, i.e. is a live-in.
164 VPRecipeBase *getDefiningRecipe();
165 const VPRecipeBase *getDefiningRecipe() const;
166
167 /// Returns true if this VPValue is defined by a recipe.
168 bool hasDefiningRecipe() const { return getDefiningRecipe(); }
169
170 /// Returns true if this VPValue is a live-in, i.e. defined outside the VPlan.
171 bool isLiveIn() const { return !hasDefiningRecipe(); }
172
173 /// Returns the underlying IR value, if this VPValue is defined outside the
174 /// scope of VPlan. Returns nullptr if the VPValue is defined by a VPDef
175 /// inside a VPlan.
177 assert(isLiveIn() &&
178 "VPValue is not a live-in; it is defined by a VPDef inside a VPlan");
179 return getUnderlyingValue();
180 }
181
182 /// Returns true if the VPValue is defined outside any loop.
183 bool isDefinedOutsideLoopRegions() const;
184
185 // Set \p Val as the underlying Value of this VPValue.
187 assert(!UnderlyingVal && "Underlying Value is already set.");
188 UnderlyingVal = Val;
189 }
190};
191
194
196
197/// This class augments VPValue with operands which provide the inverse def-use
198/// edges from VPValue's users to their defs.
199class VPUser {
200 /// Grant access to removeOperand for VPPhiAccessors, the only supported user.
201 friend class VPPhiAccessors;
202
204
205 /// Removes the operand at index \p Idx. This also removes the VPUser from the
206 /// use-list of the operand.
207 void removeOperand(unsigned Idx) {
208 getOperand(Idx)->removeUser(*this);
209 Operands.erase(Operands.begin() + Idx);
210 }
211
212protected:
213#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
214 /// Print the operands to \p O.
216#endif
217
219 for (VPValue *Operand : Operands)
220 addOperand(Operand);
221 }
222
223public:
224 VPUser() = delete;
225 VPUser(const VPUser &) = delete;
226 VPUser &operator=(const VPUser &) = delete;
227 virtual ~VPUser() {
228 for (VPValue *Op : operands())
229 Op->removeUser(*this);
230 }
231
232 void addOperand(VPValue *Operand) {
233 Operands.push_back(Operand);
234 Operand->addUser(*this);
235 }
236
237 unsigned getNumOperands() const { return Operands.size(); }
238 inline VPValue *getOperand(unsigned N) const {
239 assert(N < Operands.size() && "Operand index out of bounds");
240 return Operands[N];
241 }
242
243 void setOperand(unsigned I, VPValue *New) {
244 Operands[I]->removeUser(*this);
245 Operands[I] = New;
246 New->addUser(*this);
247 }
248
249 /// Swap operands of the VPUser. It must have exactly 2 operands.
251 assert(Operands.size() == 2 && "must have 2 operands to swap");
252 std::swap(Operands[0], Operands[1]);
253 }
254
255 /// Replaces all uses of \p From in the VPUser with \p To.
256 void replaceUsesOfWith(VPValue *From, VPValue *To);
257
262
263 operand_iterator op_begin() { return Operands.begin(); }
264 const_operand_iterator op_begin() const { return Operands.begin(); }
265 operand_iterator op_end() { return Operands.end(); }
266 const_operand_iterator op_end() const { return Operands.end(); }
271
272 /// Returns true if the VPUser uses scalars of operand \p Op. Conservatively
273 /// returns if only first (scalar) lane is used, as default.
274 virtual bool usesScalars(const VPValue *Op) const {
276 "Op must be an operand of the recipe");
277 return onlyFirstLaneUsed(Op);
278 }
279
280 /// Returns true if the VPUser only uses the first lane of operand \p Op.
281 /// Conservatively returns false.
282 virtual bool onlyFirstLaneUsed(const VPValue *Op) const {
284 "Op must be an operand of the recipe");
285 return false;
286 }
287
288 /// Returns true if the VPUser only uses the first part of operand \p Op.
289 /// Conservatively returns false.
290 virtual bool onlyFirstPartUsed(const VPValue *Op) const {
292 "Op must be an operand of the recipe");
293 return false;
294 }
295};
296
297/// This class augments a recipe with a set of VPValues defined by the recipe.
298/// It allows recipes to define zero, one or multiple VPValues. A VPDef owns
299/// the VPValues it defines and is responsible for deleting its defined values.
300/// Single-value VPDefs that also inherit from VPValue must make sure to inherit
301/// from VPDef before VPValue.
302class VPDef {
303 friend class VPValue;
304
305 /// Subclass identifier (for isa/dyn_cast).
306 const unsigned char SubclassID;
307
308 /// The VPValues defined by this VPDef.
309 TinyPtrVector<VPValue *> DefinedValues;
310
311 /// Add \p V as a defined value by this VPDef.
312 void addDefinedValue(VPValue *V) {
313 assert(V->Def == this &&
314 "can only add VPValue already linked with this VPDef");
315 DefinedValues.push_back(V);
316 }
317
318 /// Remove \p V from the values defined by this VPDef. \p V must be a defined
319 /// value of this VPDef.
320 void removeDefinedValue(VPValue *V) {
321 assert(V->Def == this && "can only remove VPValue linked with this VPDef");
322 assert(is_contained(DefinedValues, V) &&
323 "VPValue to remove must be in DefinedValues");
324 llvm::erase(DefinedValues, V);
325 V->Def = nullptr;
326 }
327
328public:
329 /// An enumeration for keeping track of the concrete subclass of VPRecipeBase
330 /// that is actually instantiated. Values of this enumeration are kept in the
331 /// SubclassID field of the VPRecipeBase objects. They are used for concrete
332 /// type identification.
333 using VPRecipeTy = enum {
334 VPBranchOnMaskSC,
335 VPDerivedIVSC,
336 VPExpandSCEVSC,
337 VPExpressionSC,
338 VPIRInstructionSC,
339 VPInstructionSC,
340 VPInterleaveEVLSC,
341 VPInterleaveSC,
342 VPReductionEVLSC,
343 VPReductionSC,
344 VPPartialReductionSC,
345 VPReplicateSC,
346 VPScalarIVStepsSC,
347 VPVectorPointerSC,
348 VPVectorEndPointerSC,
349 VPWidenCallSC,
350 VPWidenCanonicalIVSC,
351 VPWidenCastSC,
352 VPWidenGEPSC,
353 VPWidenIntrinsicSC,
354 VPWidenLoadEVLSC,
355 VPWidenLoadSC,
356 VPWidenStoreEVLSC,
357 VPWidenStoreSC,
358 VPWidenSC,
359 VPWidenSelectSC,
360 VPBlendSC,
361 VPHistogramSC,
362 // START: Phi-like recipes. Need to be kept together.
363 VPWidenPHISC,
364 VPPredInstPHISC,
365 // START: SubclassID for recipes that inherit VPHeaderPHIRecipe.
366 // VPHeaderPHIRecipe need to be kept together.
367 VPCanonicalIVPHISC,
368 VPActiveLaneMaskPHISC,
369 VPEVLBasedIVPHISC,
370 VPFirstOrderRecurrencePHISC,
371 VPWidenIntOrFpInductionSC,
372 VPWidenPointerInductionSC,
373 VPReductionPHISC,
374 // END: SubclassID for recipes that inherit VPHeaderPHIRecipe
375 // END: Phi-like recipes
376 VPFirstPHISC = VPWidenPHISC,
377 VPFirstHeaderPHISC = VPCanonicalIVPHISC,
378 VPLastHeaderPHISC = VPReductionPHISC,
379 VPLastPHISC = VPReductionPHISC,
380 };
381
382 VPDef(const unsigned char SC) : SubclassID(SC) {}
383
384 virtual ~VPDef() {
385 for (VPValue *D : make_early_inc_range(DefinedValues)) {
386 assert(D->Def == this &&
387 "all defined VPValues should point to the containing VPDef");
388 assert(D->getNumUsers() == 0 &&
389 "all defined VPValues should have no more users");
390 D->Def = nullptr;
391 delete D;
392 }
393 }
394
395 /// Returns the only VPValue defined by the VPDef. Can only be called for
396 /// VPDefs with a single defined value.
398 assert(DefinedValues.size() == 1 && "must have exactly one defined value");
399 assert(DefinedValues[0] && "defined value must be non-null");
400 return DefinedValues[0];
401 }
402 const VPValue *getVPSingleValue() const {
403 assert(DefinedValues.size() == 1 && "must have exactly one defined value");
404 assert(DefinedValues[0] && "defined value must be non-null");
405 return DefinedValues[0];
406 }
407
408 /// Returns the VPValue with index \p I defined by the VPDef.
409 VPValue *getVPValue(unsigned I) {
410 assert(DefinedValues[I] && "defined value must be non-null");
411 return DefinedValues[I];
412 }
413 const VPValue *getVPValue(unsigned I) const {
414 assert(DefinedValues[I] && "defined value must be non-null");
415 return DefinedValues[I];
416 }
417
418 /// Returns an ArrayRef of the values defined by the VPDef.
419 ArrayRef<VPValue *> definedValues() { return DefinedValues; }
420 /// Returns an ArrayRef of the values defined by the VPDef.
421 ArrayRef<VPValue *> definedValues() const { return DefinedValues; }
422
423 /// Returns the number of values defined by the VPDef.
424 unsigned getNumDefinedValues() const { return DefinedValues.size(); }
425
426 /// \return an ID for the concrete type of this object.
427 /// This is used to implement the classof checks. This should not be used
428 /// for any other purpose, as the values may change as LLVM evolves.
429 unsigned getVPDefID() const { return SubclassID; }
430
431#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
432 /// Dump the VPDef to stderr (for debugging).
433 void dump() const;
434
435 /// Each concrete VPDef prints itself.
436 virtual void print(raw_ostream &O, const Twine &Indent,
437 VPSlotTracker &SlotTracker) const = 0;
438#endif
439};
440
441} // namespace llvm
442
443#endif // LLVM_TRANSFORMS_VECTORIZE_VPLAN_VALUE_H
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the StringMap class.
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
static void replaceAllUsesWith(Value *Old, Value *New, SmallPtrSet< BasicBlock *, 32 > &FreshBBs, bool IsHuge)
Replace all old uses with new ones, and push the updated BBs into FreshBBs.
#define LLVM_ABI_FOR_TEST
Definition Compiler.h:218
This file defines the DenseMap class.
#define I(x, y, z)
Definition MD5.cpp:58
This file contains some templates that are useful if you are working with the STL at all.
This file defines the SmallVector class.
static const BasicSubtargetSubTypeKV * find(StringRef S, ArrayRef< BasicSubtargetSubTypeKV > A)
Find KV in array using binary search.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:41
This class provides computation of slot numbers for LLVM Assembly writing.
typename SuperClass::const_iterator const_iterator
typename SuperClass::iterator iterator
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
TinyPtrVector - This class is specialized for cases where there are normally 0 or 1 element in a vect...
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition Twine.h:82
This class augments a recipe with a set of VPValues defined by the recipe.
Definition VPlanValue.h:302
void dump() const
Dump the VPDef to stderr (for debugging).
Definition VPlan.cpp:126
unsigned getNumDefinedValues() const
Returns the number of values defined by the VPDef.
Definition VPlanValue.h:424
virtual ~VPDef()
Definition VPlanValue.h:384
ArrayRef< VPValue * > definedValues()
Returns an ArrayRef of the values defined by the VPDef.
Definition VPlanValue.h:419
VPValue * getVPSingleValue()
Returns the only VPValue defined by the VPDef.
Definition VPlanValue.h:397
const VPValue * getVPSingleValue() const
Definition VPlanValue.h:402
ArrayRef< VPValue * > definedValues() const
Returns an ArrayRef of the values defined by the VPDef.
Definition VPlanValue.h:421
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:409
friend class VPValue
Definition VPlanValue.h:303
unsigned getVPDefID() const
Definition VPlanValue.h:429
VPDef(const unsigned char SC)
Definition VPlanValue.h:382
enum { VPBranchOnMaskSC, VPDerivedIVSC, VPExpandSCEVSC, VPExpressionSC, VPIRInstructionSC, VPInstructionSC, VPInterleaveEVLSC, VPInterleaveSC, VPReductionEVLSC, VPReductionSC, VPPartialReductionSC, VPReplicateSC, VPScalarIVStepsSC, VPVectorPointerSC, VPVectorEndPointerSC, VPWidenCallSC, VPWidenCanonicalIVSC, VPWidenCastSC, VPWidenGEPSC, VPWidenIntrinsicSC, VPWidenLoadEVLSC, VPWidenLoadSC, VPWidenStoreEVLSC, VPWidenStoreSC, VPWidenSC, VPWidenSelectSC, VPBlendSC, VPHistogramSC, VPWidenPHISC, VPPredInstPHISC, VPCanonicalIVPHISC, VPActiveLaneMaskPHISC, VPEVLBasedIVPHISC, VPFirstOrderRecurrencePHISC, VPWidenIntOrFpInductionSC, VPWidenPointerInductionSC, VPReductionPHISC, VPFirstPHISC=VPWidenPHISC, 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:333
const VPValue * getVPValue(unsigned I) const
Definition VPlanValue.h:413
A common base class for interleaved memory operations.
Definition VPlan.h:2470
Helper type to provide functions to access incoming values and blocks for phi-like recipes.
Definition VPlan.h:1245
VPRecipeBase is a base class modeling a sequence of one or more output IR instructions.
Definition VPlan.h:394
This class can be used to assign names to VPValues.
This class augments VPValue with operands which provide the inverse def-use edges from VPValue's user...
Definition VPlanValue.h:199
void replaceUsesOfWith(VPValue *From, VPValue *To)
Replaces all uses of From in the VPUser with To.
Definition VPlan.cpp:1443
void printOperands(raw_ostream &O, VPSlotTracker &SlotTracker) const
Print the operands to O.
Definition VPlan.cpp:1455
operand_range operands()
Definition VPlanValue.h:267
void setOperand(unsigned I, VPValue *New)
Definition VPlanValue.h:243
VPUser & operator=(const VPUser &)=delete
friend class VPPhiAccessors
Grant access to removeOperand for VPPhiAccessors, the only supported user.
Definition VPlanValue.h:201
unsigned getNumOperands() const
Definition VPlanValue.h:237
SmallVectorImpl< VPValue * >::const_iterator const_operand_iterator
Definition VPlanValue.h:259
const_operand_iterator op_begin() const
Definition VPlanValue.h:264
operand_iterator op_end()
Definition VPlanValue.h:265
const_operand_range operands() const
Definition VPlanValue.h:268
operand_iterator op_begin()
Definition VPlanValue.h:263
VPValue * getOperand(unsigned N) const
Definition VPlanValue.h:238
VPUser(ArrayRef< VPValue * > Operands)
Definition VPlanValue.h:218
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:282
iterator_range< const_operand_iterator > const_operand_range
Definition VPlanValue.h:261
void swapOperands()
Swap operands of the VPUser. It must have exactly 2 operands.
Definition VPlanValue.h:250
SmallVectorImpl< VPValue * >::iterator operand_iterator
Definition VPlanValue.h:258
virtual ~VPUser()
Definition VPlanValue.h:227
virtual bool onlyFirstPartUsed(const VPValue *Op) const
Returns true if the VPUser only uses the first part of operand Op.
Definition VPlanValue.h:290
const_operand_iterator op_end() const
Definition VPlanValue.h:266
virtual bool usesScalars(const VPValue *Op) const
Returns true if the VPUser uses scalars of operand Op.
Definition VPlanValue.h:274
iterator_range< operand_iterator > operand_range
Definition VPlanValue.h:260
void addOperand(VPValue *Operand)
Definition VPlanValue.h:232
bool hasDefiningRecipe() const
Returns true if this VPValue is defined by a recipe.
Definition VPlanValue.h:168
VPValue(Value *UV=nullptr)
Create a live-in VPValue.
Definition VPlanValue.h:70
unsigned getVPValueID() const
Definition VPlanValue.h:103
VPRecipeBase * getDefiningRecipe()
Returns the recipe defining this VPValue or nullptr if it is not defined by a recipe,...
Definition VPlan.cpp:135
friend class VPExpressionRecipe
Definition VPlanValue.h:53
void removeUser(VPUser &User)
Remove a single User from the list of users.
Definition VPlanValue.h:117
SmallVectorImpl< VPUser * >::const_iterator const_user_iterator
Definition VPlanValue.h:126
const_user_iterator user_begin() const
Definition VPlanValue.h:131
void addUser(VPUser &User)
Definition VPlanValue.h:114
bool hasMoreThanOneUniqueUser() const
Returns true if the value has more than one unique user.
Definition VPlanValue.h:140
Value * getLiveInIRValue() const
Returns the underlying IR value, if this VPValue is defined outside the scope of VPlan.
Definition VPlanValue.h:176
friend class VPDef
Definition VPlanValue.h:49
Value * getUnderlyingValue() const
Return the underlying Value attached to this VPValue.
Definition VPlanValue.h:85
Value * UnderlyingVal
Definition VPlanValue.h:61
VPValue(Value *UV, VPDef *Def)
Create a VPValue for a Def which defines multiple values.
Definition VPlanValue.h:74
const_user_range users() const
Definition VPlanValue.h:135
VPValue(const VPValue &)=delete
VPValue & operator=(const VPValue &)=delete
@ VPVRecipeSC
A generic VPValue, like live-in values or defined by a recipe that defines multiple values.
Definition VPlanValue.h:92
bool hasOneUse() const
Definition VPlanValue.h:151
VPValue(const unsigned char SC, Value *UV=nullptr, VPDef *Def=nullptr)
Definition VPlan.cpp:98
void setUnderlyingValue(Value *Val)
Definition VPlanValue.h:186
SmallVectorImpl< VPUser * >::iterator user_iterator
Definition VPlanValue.h:125
iterator_range< user_iterator > user_range
Definition VPlanValue.h:127
const_user_iterator user_end() const
Definition VPlanValue.h:133
VPValue(VPDef *Def, Value *UV=nullptr)
Create a VPValue for a Def which is a subclass of VPValue.
Definition VPlanValue.h:72
user_iterator user_begin()
Definition VPlanValue.h:130
friend class VPInterleaveBase
Definition VPlanValue.h:51
unsigned getNumUsers() const
Definition VPlanValue.h:113
user_iterator user_end()
Definition VPlanValue.h:132
bool isLiveIn() const
Returns true if this VPValue is a live-in, i.e. defined outside the VPlan.
Definition VPlanValue.h:171
friend struct VPDoubleValueDef
Definition VPlanValue.h:50
user_range users()
Definition VPlanValue.h:134
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:128
friend class VPlan
Definition VPlanValue.h:52
LLVM Value Representation.
Definition Value.h:75
An efficient, type-erasing, non-owning reference to a callable.
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:53
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.
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
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:634
void erase(Container &C, ValueType V)
Wrapper function to remove a value from a container:
Definition STLExtras.h:2108
DenseMap< VPValue *, Value * > VPValue2ValueTy
Definition VPlanValue.h:193
DWARFExpression::Operation Op
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
Definition STLExtras.h:1877
DenseMap< Value *, VPValue * > Value2VPValueTy
Definition VPlanValue.h:192
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
Definition BitVector.h:853
#define N