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