LLVM  16.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"
25 #include "llvm/ADT/SmallVector.h"
26 #include "llvm/ADT/TinyPtrVector.h"
28 
29 namespace llvm {
30 
31 // Forward declarations.
32 class raw_ostream;
33 class Value;
34 class VPDef;
35 class VPSlotTracker;
36 class VPUser;
37 class VPRecipeBase;
38 class 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.
44 class 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 
59 protected:
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 
82 public:
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. Values of this enumeration are kept in the
89  /// SubclassID field of the VPValue objects. They are used for concrete
90  /// type identification.
91  enum {
102 
103  // Phi-like VPValues. Need to be kept together.
106  // Header-phi recipes. Need to be kept together.
116  };
117 
118  VPValue(Value *UV = nullptr, VPDef *Def = nullptr)
119  : VPValue(VPValueSC, UV, Def) {}
120  VPValue(const VPValue &) = delete;
121  VPValue &operator=(const VPValue &) = delete;
122 
123  virtual ~VPValue();
124 
125  /// \return an ID for the concrete type of this object.
126  /// This is used to implement the classof checks. This should not be used
127  /// for any other purpose, as the values may change as LLVM evolves.
128  unsigned getVPValueID() const { return SubclassID; }
129 
130 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
131  void printAsOperand(raw_ostream &OS, VPSlotTracker &Tracker) const;
132  void print(raw_ostream &OS, VPSlotTracker &Tracker) const;
133 
134  /// Dump the value to stderr (for debugging).
135  void dump() const;
136 #endif
137 
138  unsigned getNumUsers() const { return Users.size(); }
139  void addUser(VPUser &User) { Users.push_back(&User); }
140 
141  /// Remove a single \p User from the list of users.
143  bool Found = false;
144  // The same user can be added multiple times, e.g. because the same VPValue
145  // is used twice by the same VPUser. Remove a single one.
146  erase_if(Users, [&User, &Found](VPUser *Other) {
147  if (Found)
148  return false;
149  if (Other == &User) {
150  Found = true;
151  return true;
152  }
153  return false;
154  });
155  }
156 
161 
162  user_iterator user_begin() { return Users.begin(); }
163  const_user_iterator user_begin() const { return Users.begin(); }
164  user_iterator user_end() { return Users.end(); }
165  const_user_iterator user_end() const { return Users.end(); }
168  return const_user_range(user_begin(), user_end());
169  }
170 
171  /// Returns true if the value has more than one unique user.
173  if (getNumUsers() == 0)
174  return false;
175 
176  // Check if all users match the first user.
177  auto Current = std::next(user_begin());
178  while (Current != user_end() && *user_begin() == *Current)
179  Current++;
180  return Current != user_end();
181  }
182 
183  void replaceAllUsesWith(VPValue *New);
184 
185  /// Returns the recipe defining this VPValue or nullptr if it is not defined
186  /// by a recipe, i.e. is a live-in.
188  const VPRecipeBase *getDefiningRecipe() const;
189 
190  /// Returns true if this VPValue is defined by a recipe.
191  bool hasDefiningRecipe() const { return getDefiningRecipe(); }
192 
193  /// Returns the underlying IR value, if this VPValue is defined outside the
194  /// scope of VPlan. Returns nullptr if the VPValue is defined by a VPDef
195  /// inside a VPlan.
198  "VPValue is not a live-in; it is defined by a VPDef inside a VPlan");
199  return getUnderlyingValue();
200  }
201  const Value *getLiveInIRValue() const {
203  "VPValue is not a live-in; it is defined by a VPDef inside a VPlan");
204  return getUnderlyingValue();
205  }
206 
207  /// Returns true if the VPValue is defined outside any vector regions, i.e. it
208  /// is a live-in value.
209  /// TODO: Also handle recipes defined in pre-header blocks.
211 };
212 
215 
216 raw_ostream &operator<<(raw_ostream &OS, const VPValue &V);
217 
218 /// This class augments VPValue with operands which provide the inverse def-use
219 /// edges from VPValue's users to their defs.
220 class VPUser {
221 public:
222  /// Subclass identifier (for isa/dyn_cast).
223  enum class VPUserID {
224  Recipe,
225  LiveOut,
226  };
227 
228 private:
229  SmallVector<VPValue *, 2> Operands;
230 
231  VPUserID ID;
232 
233 protected:
234 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
235  /// Print the operands to \p O.
237 #endif
238 
240  for (VPValue *Operand : Operands)
241  addOperand(Operand);
242  }
243 
244  VPUser(std::initializer_list<VPValue *> Operands, VPUserID ID)
245  : VPUser(ArrayRef<VPValue *>(Operands), ID) {}
246 
247  template <typename IterT>
249  for (VPValue *Operand : Operands)
250  addOperand(Operand);
251  }
252 
253 public:
254  VPUser() = delete;
255  VPUser(const VPUser &) = delete;
256  VPUser &operator=(const VPUser &) = delete;
257  virtual ~VPUser() {
258  for (VPValue *Op : operands())
259  Op->removeUser(*this);
260  }
261 
262  VPUserID getVPUserID() const { return ID; }
263 
264  void addOperand(VPValue *Operand) {
265  Operands.push_back(Operand);
266  Operand->addUser(*this);
267  }
268 
269  unsigned getNumOperands() const { return Operands.size(); }
270  inline VPValue *getOperand(unsigned N) const {
271  assert(N < Operands.size() && "Operand index out of bounds");
272  return Operands[N];
273  }
274 
275  void setOperand(unsigned I, VPValue *New) {
276  Operands[I]->removeUser(*this);
277  Operands[I] = New;
278  New->addUser(*this);
279  }
280 
282  VPValue *Op = Operands.pop_back_val();
283  Op->removeUser(*this);
284  }
285 
290 
291  operand_iterator op_begin() { return Operands.begin(); }
292  const_operand_iterator op_begin() const { return Operands.begin(); }
293  operand_iterator op_end() { return Operands.end(); }
294  const_operand_iterator op_end() const { return Operands.end(); }
297  return const_operand_range(op_begin(), op_end());
298  }
299 
300  /// Method to support type inquiry through isa, cast, and dyn_cast.
301  static inline bool classof(const VPDef *Recipe);
302 
303  /// Returns true if the VPUser uses scalars of operand \p Op. Conservatively
304  /// returns if only first (scalar) lane is used, as default.
305  virtual bool usesScalars(const VPValue *Op) const {
307  "Op must be an operand of the recipe");
308  return onlyFirstLaneUsed(Op);
309  }
310 
311  /// Returns true if the VPUser only uses the first lane of operand \p Op.
312  /// Conservatively returns false.
313  virtual bool onlyFirstLaneUsed(const VPValue *Op) const {
315  "Op must be an operand of the recipe");
316  return false;
317  }
318 };
319 
320 /// This class augments a recipe with a set of VPValues defined by the recipe.
321 /// It allows recipes to define zero, one or multiple VPValues. A VPDef owns
322 /// the VPValues it defines and is responsible for deleting its defined values.
323 /// Single-value VPDefs that also inherit from VPValue must make sure to inherit
324 /// from VPDef before VPValue.
325 class VPDef {
326  friend class VPValue;
327 
328  /// Subclass identifier (for isa/dyn_cast).
329  const unsigned char SubclassID;
330 
331  /// The VPValues defined by this VPDef.
332  TinyPtrVector<VPValue *> DefinedValues;
333 
334  /// Add \p V as a defined value by this VPDef.
335  void addDefinedValue(VPValue *V) {
336  assert(V->Def == this &&
337  "can only add VPValue already linked with this VPDef");
338  DefinedValues.push_back(V);
339  }
340 
341  /// Remove \p V from the values defined by this VPDef. \p V must be a defined
342  /// value of this VPDef.
343  void removeDefinedValue(VPValue *V) {
344  assert(V->Def == this && "can only remove VPValue linked with this VPDef");
345  assert(is_contained(DefinedValues, V) &&
346  "VPValue to remove must be in DefinedValues");
347  erase_value(DefinedValues, V);
348  V->Def = nullptr;
349  }
350 
351 public:
352  /// An enumeration for keeping track of the concrete subclass of VPRecipeBase
353  /// that is actually instantiated. Values of this enumeration are kept in the
354  /// SubclassID field of the VPRecipeBase objects. They are used for concrete
355  /// type identification.
356  using VPRecipeTy = enum {
357  VPBranchOnMaskSC,
358  VPExpandSCEVSC,
359  VPInstructionSC,
360  VPInterleaveSC,
361  VPReductionSC,
362  VPReplicateSC,
363  VPScalarIVStepsSC,
364  VPWidenCallSC,
365  VPWidenCanonicalIVSC,
366  VPWidenGEPSC,
367  VPWidenMemoryInstructionSC,
368  VPWidenSC,
369  VPWidenSelectSC,
370 
371  // Phi-like recipes. Need to be kept together.
372  VPBlendSC,
373  VPPredInstPHISC,
374  // Header-phi recipes. Need to be kept together.
375  VPCanonicalIVPHISC,
376  VPActiveLaneMaskPHISC,
377  VPFirstOrderRecurrencePHISC,
378  VPWidenPHISC,
379  VPWidenIntOrFpInductionSC,
380  VPWidenPointerInductionSC,
381  VPReductionPHISC,
382  VPFirstPHISC = VPBlendSC,
383  VPFirstHeaderPHISC = VPCanonicalIVPHISC,
384  VPLastPHISC = VPReductionPHISC,
385  };
386 
387  VPDef(const unsigned char SC) : SubclassID(SC) {}
388 
389  virtual ~VPDef() {
390  for (VPValue *D : make_early_inc_range(DefinedValues)) {
391  assert(D->Def == this &&
392  "all defined VPValues should point to the containing VPDef");
393  assert(D->getNumUsers() == 0 &&
394  "all defined VPValues should have no more users");
395  D->Def = nullptr;
396  delete D;
397  }
398  }
399 
400  /// Returns the only VPValue defined by the VPDef. Can only be called for
401  /// VPDefs with a single defined value.
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  const VPValue *getVPSingleValue() const {
408  assert(DefinedValues.size() == 1 && "must have exactly one defined value");
409  assert(DefinedValues[0] && "defined value must be non-null");
410  return DefinedValues[0];
411  }
412 
413  /// Returns the VPValue with index \p I defined by the VPDef.
414  VPValue *getVPValue(unsigned I) {
415  assert(DefinedValues[I] && "defined value must be non-null");
416  return DefinedValues[I];
417  }
418  const VPValue *getVPValue(unsigned I) const {
419  assert(DefinedValues[I] && "defined value must be non-null");
420  return DefinedValues[I];
421  }
422 
423  /// Returns an ArrayRef of the values defined by the VPDef.
424  ArrayRef<VPValue *> definedValues() { return DefinedValues; }
425  /// Returns an ArrayRef of the values defined by the VPDef.
426  ArrayRef<VPValue *> definedValues() const { return DefinedValues; }
427 
428  /// Returns the number of values defined by the VPDef.
429  unsigned getNumDefinedValues() const { return DefinedValues.size(); }
430 
431  /// \return an ID for the concrete type of this object.
432  /// This is used to implement the classof checks. This should not be used
433  /// for any other purpose, as the values may change as LLVM evolves.
434  unsigned getVPDefID() const { return SubclassID; }
435 
436 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
437  /// Dump the VPDef to stderr (for debugging).
438  void dump() const;
439 
440  /// Each concrete VPDef prints itself.
441  virtual void print(raw_ostream &O, const Twine &Indent,
442  VPSlotTracker &SlotTracker) const = 0;
443 #endif
444 };
445 
446 class VPlan;
447 class VPBasicBlock;
448 
449 /// This class can be used to assign consecutive numbers to all VPValues in a
450 /// VPlan and allows querying the numbering for printing, similar to the
451 /// ModuleSlotTracker for IR values.
454  unsigned NextSlot = 0;
455 
456  void assignSlot(const VPValue *V);
457  void assignSlots(const VPlan &Plan);
458 
459 public:
460  VPSlotTracker(const VPlan *Plan = nullptr) {
461  if (Plan)
462  assignSlots(*Plan);
463  }
464 
465  unsigned getSlot(const VPValue *V) const {
466  auto I = Slots.find(V);
467  if (I == Slots.end())
468  return -1;
469  return I->second;
470  }
471 };
472 
473 } // namespace llvm
474 
475 #endif // LLVM_TRANSFORMS_VECTORIZE_VPLAN_VALUE_H
llvm::VPUser::getVPUserID
VPUserID getVPUserID() const
Definition: VPlanValue.h:262
llvm::VPUser::op_end
operand_iterator op_end()
Definition: VPlanValue.h:293
llvm::VPValue::VPVWidenPointerInductionSC
@ VPVWidenPointerInductionSC
Definition: VPlanValue.h:112
llvm::VPValue::VPVPredInstPHI
@ VPVPredInstPHI
Definition: VPlanValue.h:105
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::VPDef::VPRecipeTy
enum { VPBranchOnMaskSC, VPExpandSCEVSC, VPInstructionSC, VPInterleaveSC, VPReductionSC, VPReplicateSC, VPScalarIVStepsSC, VPWidenCallSC, VPWidenCanonicalIVSC, VPWidenGEPSC, VPWidenMemoryInstructionSC, VPWidenSC, VPWidenSelectSC, VPBlendSC, VPPredInstPHISC, VPCanonicalIVPHISC, VPActiveLaneMaskPHISC, VPFirstOrderRecurrencePHISC, VPWidenPHISC, VPWidenIntOrFpInductionSC, VPWidenPointerInductionSC, VPReductionPHISC, VPFirstPHISC=VPBlendSC, VPFirstHeaderPHISC=VPCanonicalIVPHISC, VPLastPHISC=VPReductionPHISC, } VPRecipeTy
An enumeration for keeping track of the concrete subclass of VPRecipeBase that is actually instantiat...
Definition: VPlanValue.h:385
llvm::VPUser::VPUser
VPUser(iterator_range< IterT > Operands, VPUserID ID)
Definition: VPlanValue.h:248
llvm::VPValue::user_end
const_user_iterator user_end() const
Definition: VPlanValue.h:165
llvm::VPUser::removeLastOperand
void removeLastOperand()
Definition: VPlanValue.h:281
llvm::VPBasicBlock
VPBasicBlock serves as the leaf of the Hierarchical Control-Flow Graph.
Definition: VPlan.h:2013
llvm::VPValue::user_iterator
SmallVectorImpl< VPUser * >::iterator user_iterator
Definition: VPlanValue.h:157
llvm::VPValue::getLiveInIRValue
Value * getLiveInIRValue()
Returns the underlying IR value, if this VPValue is defined outside the scope of VPlan.
Definition: VPlanValue.h:196
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1199
llvm::VPDef::getVPSingleValue
VPValue * getVPSingleValue()
Returns the only VPValue defined by the VPDef.
Definition: VPlanValue.h:402
llvm::VPInterleavedAccessInfo
Definition: VPlan.h:2909
llvm::VPDef::print
virtual void print(raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const =0
Each concrete VPDef prints itself.
llvm::VPValue::user_range
iterator_range< user_iterator > user_range
Definition: VPlanValue.h:159
llvm::erase_if
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:1972
llvm::VPValue::operator=
VPValue & operator=(const VPValue &)=delete
DenseMap.h
llvm::VPValue::dump
void dump() const
Dump the value to stderr (for debugging).
Definition: VPlan.cpp:95
llvm::VPValue::VPVReductionPHISC
@ VPVReductionPHISC
Definition: VPlanValue.h:113
llvm::VPUser::op_begin
operand_iterator op_begin()
Definition: VPlanValue.h:291
llvm::VPDef::VPDef
VPDef(const unsigned char SC)
Definition: VPlanValue.h:387
llvm::VPDef::getVPSingleValue
const VPValue * getVPSingleValue() const
Definition: VPlanValue.h:407
llvm::VPValue::print
void print(raw_ostream &OS, VPSlotTracker &Tracker) const
Definition: VPlan.cpp:88
STLExtras.h
llvm::VPUser::operands
operand_range operands()
Definition: VPlanValue.h:295
llvm::VPUser::VPUserID
VPUserID
Subclass identifier (for isa/dyn_cast).
Definition: VPlanValue.h:223
llvm::VPValue::VPValue
VPValue(const unsigned char SC, Value *UV=nullptr, VPDef *Def=nullptr)
Definition: VPlan.cpp:75
llvm::VPValue::VPValueSC
@ VPValueSC
Definition: VPlanValue.h:92
llvm::VPUser::const_operand_iterator
SmallVectorImpl< VPValue * >::const_iterator const_operand_iterator
Definition: VPlanValue.h:287
llvm::VPValue::users
user_range users()
Definition: VPlanValue.h:166
llvm::VPValue::VPVReplicateSC
@ VPVReplicateSC
Definition: VPlanValue.h:96
llvm::VPDef
This class augments a recipe with a set of VPValues defined by the recipe.
Definition: VPlanValue.h:325
llvm::VPUser::VPUser
VPUser(std::initializer_list< VPValue * > Operands, VPUserID ID)
Definition: VPlanValue.h:244
llvm::VPInstruction
This is a concrete Recipe that models a single VPlan-level instruction.
Definition: VPlan.h:775
llvm::VPUser::op_end
const_operand_iterator op_end() const
Definition: VPlanValue.h:294
llvm::PPCISD::SC
@ SC
CHAIN = SC CHAIN, Imm128 - System call.
Definition: PPCISelLowering.h:419
llvm::VPBuilder
VPlan-based builder utility analogous to IRBuilder.
Definition: LoopVectorizationPlanner.h:43
llvm::User
Definition: User.h:44
llvm::VPValue::VPVWidenSC
@ VPVWidenSC
Definition: VPlanValue.h:97
llvm::VPValue::addUser
void addUser(VPUser &User)
Definition: VPlanValue.h:139
llvm::VPDef::definedValues
ArrayRef< VPValue * > definedValues() const
Returns an ArrayRef of the values defined by the VPDef.
Definition: VPlanValue.h:426
llvm::TinyPtrVector::push_back
void push_back(EltTy NewVal)
Definition: TinyPtrVector.h:244
llvm::VPUser::VPUserID::Recipe
@ Recipe
llvm::VPValue::replaceAllUsesWith
void replaceAllUsesWith(VPValue *New)
Definition: VPlan.cpp:987
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
llvm::VPValue
Definition: VPlanValue.h:44
llvm::operator<<
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
Definition: APFixedPoint.h:291
llvm::VPValue::VPVLastPHISC
@ VPVLastPHISC
Definition: VPlanValue.h:115
llvm::VPDef::getNumDefinedValues
unsigned getNumDefinedValues() const
Returns the number of values defined by the VPDef.
Definition: VPlanValue.h:429
llvm::VPValue::getUnderlyingValue
const Value * getUnderlyingValue() const
Definition: VPlanValue.h:85
llvm::VPValue::users
const_user_range users() const
Definition: VPlanValue.h:167
llvm::VPUser::getNumOperands
unsigned getNumOperands() const
Definition: VPlanValue.h:269
llvm::VPValue::VPVReductionSC
@ VPVReductionSC
Definition: VPlanValue.h:95
llvm::CallingConv::ID
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition: CallingConv.h:24
llvm::erase_value
void erase_value(Container &C, ValueType V)
Wrapper function to remove a value from a container:
Definition: STLExtras.h:1980
llvm::VPValue::VPVActiveLaneMaskPHISC
@ VPVActiveLaneMaskPHISC
Definition: VPlanValue.h:108
llvm::VPValue::getLiveInIRValue
const Value * getLiveInIRValue() const
Definition: VPlanValue.h:201
llvm::VPValue::VPVFirstHeaderPHISC
@ VPVFirstHeaderPHISC
Definition: VPlanValue.h:114
Operands
mir Rename Register Operands
Definition: MIRNamerPass.cpp:74
llvm::VPUser::setOperand
void setOperand(unsigned I, VPValue *New)
Definition: VPlanValue.h:275
llvm::RISCVFenceField::O
@ O
Definition: RISCVBaseInfo.h:264
llvm::VPValue::Def
VPDef * Def
Pointer to the VPDef that defines this VPValue.
Definition: VPlanValue.h:65
llvm::VPSlotTracker::getSlot
unsigned getSlot(const VPValue *V) const
Definition: VPlanValue.h:465
llvm::VPValue::VPVWidenSelectSC
@ VPVWidenSelectSC
Definition: VPlanValue.h:101
D
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
llvm::VPValue::VPVWidenCallSC
@ VPVWidenCallSC
Definition: VPlanValue.h:98
llvm::DenseMap< Value *, VPValue * >
llvm::VPValue::getNumUsers
unsigned getNumUsers() const
Definition: VPlanValue.h:138
I
#define I(x, y, z)
Definition: MD5.cpp:58
llvm::make_early_inc_range
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:716
llvm::VPUser::op_begin
const_operand_iterator op_begin() const
Definition: VPlanValue.h:292
llvm::is_contained
bool is_contained(R &&Range, const E &Element)
Wrapper function around std::find to detect if an element exists in a container.
Definition: STLExtras.h:1843
llvm::VPValue::user_end
user_iterator user_end()
Definition: VPlanValue.h:164
llvm::DenseMapBase< DenseMap< KeyT, ValueT, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >, KeyT, ValueT, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >::find
iterator find(const_arg_type_t< KeyT > Val)
Definition: DenseMap.h:150
llvm::SmallVectorImpl::const_iterator
typename SuperClass::const_iterator const_iterator
Definition: SmallVector.h:582
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::VPValue::user_begin
const_user_iterator user_begin() const
Definition: VPlanValue.h:163
iterator_range.h
llvm::Value2VPValueTy
DenseMap< Value *, VPValue * > Value2VPValueTy
Definition: VPlanValue.h:213
llvm::VPUser::printOperands
void printOperands(raw_ostream &O, VPSlotTracker &SlotTracker) const
Print the operands to O.
Definition: VPlan.cpp:1018
llvm::VPWidenMemoryInstructionRecipe
A Recipe for widening load/store operations.
Definition: VPlan.h:1702
TinyPtrVector.h
llvm::VPValue::hasDefiningRecipe
bool hasDefiningRecipe() const
Returns true if this VPValue is defined by a recipe.
Definition: VPlanValue.h:191
llvm::VPSlotTracker::VPSlotTracker
VPSlotTracker(const VPlan *Plan=nullptr)
Definition: VPlanValue.h:460
llvm::VPValue::VPVInstructionSC
@ VPVInstructionSC
Definition: VPlanValue.h:93
llvm::VPValue::user_begin
user_iterator user_begin()
Definition: VPlanValue.h:162
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::TinyPtrVector::size
unsigned size() const
Definition: TinyPtrVector.h:172
llvm::VPUser::~VPUser
virtual ~VPUser()
Definition: VPlanValue.h:257
llvm::VPUser::addOperand
void addOperand(VPValue *Operand)
Definition: VPlanValue.h:264
llvm::VPValue::VPVMemoryInstructionSC
@ VPVMemoryInstructionSC
Definition: VPlanValue.h:94
llvm::VPUser::onlyFirstLaneUsed
virtual bool onlyFirstLaneUsed(const VPValue *Op) const
Returns true if the VPUser only uses the first lane of operand Op.
Definition: VPlanValue.h:313
llvm::VPDef::getVPValue
const VPValue * getVPValue(unsigned I) const
Definition: VPlanValue.h:418
llvm::VPDef::getVPValue
VPValue * getVPValue(unsigned I)
Returns the VPValue with index I defined by the VPDef.
Definition: VPlanValue.h:414
llvm::VPValue::setUnderlyingValue
void setUnderlyingValue(Value *Val)
Definition: VPlanValue.h:77
llvm::VPUser::operand_range
iterator_range< operand_iterator > operand_range
Definition: VPlanValue.h:288
llvm::VPUser::operand_iterator
SmallVectorImpl< VPValue * >::iterator operand_iterator
Definition: VPlanValue.h:286
llvm::VPUser::classof
static bool classof(const VPDef *Recipe)
Method to support type inquiry through isa, cast, and dyn_cast.
Definition: VPlan.h:757
llvm::VPDef::dump
void dump() const
Dump the VPDef to stderr (for debugging).
Definition: VPlan.cpp:103
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:81
llvm::VPSlotTracker
This class can be used to assign consecutive numbers to all VPValues in a VPlan and allows querying t...
Definition: VPlanValue.h:452
llvm::DenseMapBase< DenseMap< KeyT, ValueT, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >, KeyT, ValueT, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >::end
iterator end()
Definition: DenseMap.h:84
llvm::AMDGPU::SendMsg::Op
Op
Definition: SIDefines.h:348
llvm::VPUser::VPUser
VPUser(ArrayRef< VPValue * > Operands, VPUserID ID)
Definition: VPlanValue.h:239
llvm::VPValue::VPVWidenGEPSC
@ VPVWidenGEPSC
Definition: VPlanValue.h:100
llvm::VPRecipeBase
VPRecipeBase is a base class modeling a sequence of one or more output IR instructions.
Definition: VPlan.h:663
llvm::VPUser::operator=
VPUser & operator=(const VPUser &)=delete
llvm::VPValue::VPVWidenPHISC
@ VPVWidenPHISC
Definition: VPlanValue.h:110
llvm::TargetStackID::Value
Value
Definition: TargetFrameLowering.h:27
llvm::VPValue::VPVWidenCanonicalIVSC
@ VPVWidenCanonicalIVSC
Definition: VPlanValue.h:99
llvm::VPValue::UnderlyingVal
Value * UnderlyingVal
Definition: VPlanValue.h:61
llvm::SlotTracker
This class provides computation of slot numbers for LLVM Assembly writing.
Definition: AsmWriter.cpp:665
llvm::VPValue::const_user_range
iterator_range< const_user_iterator > const_user_range
Definition: VPlanValue.h:160
llvm::VPValue2ValueTy
DenseMap< VPValue *, Value * > VPValue2ValueTy
Definition: VPlanValue.h:214
llvm::VPValue::VPVFirstOrderRecurrencePHISC
@ VPVFirstOrderRecurrencePHISC
Definition: VPlanValue.h:109
llvm::VPValue::hasMoreThanOneUniqueUser
bool hasMoreThanOneUniqueUser()
Returns true if the value has more than one unique user.
Definition: VPlanValue.h:172
llvm::VPUser::VPUserID::LiveOut
@ LiveOut
llvm::VPUser
This class augments VPValue with operands which provide the inverse def-use edges from VPValue's user...
Definition: VPlanValue.h:220
llvm::VPlanTransforms
Definition: VPlanTransforms.h:28
SmallVector.h
llvm::SmallVectorImpl::iterator
typename SuperClass::iterator iterator
Definition: SmallVector.h:581
llvm::VPUser::getOperand
VPValue * getOperand(unsigned N) const
Definition: VPlanValue.h:270
N
#define N
llvm::VPValue::VPVCanonicalIVPHISC
@ VPVCanonicalIVPHISC
Definition: VPlanValue.h:107
Users
iv Induction Variable Users
Definition: IVUsers.cpp:48
llvm::VPUser::VPUser
VPUser()=delete
llvm::iterator_range
A range adaptor for a pair of iterators.
Definition: iterator_range.h:30
llvm::VPDef::definedValues
ArrayRef< VPValue * > definedValues()
Returns an ArrayRef of the values defined by the VPDef.
Definition: VPlanValue.h:424
llvm::VPUser::usesScalars
virtual bool usesScalars(const VPValue *Op) const
Returns true if the VPUser uses scalars of operand Op.
Definition: VPlanValue.h:305
llvm::VPValue::getVPValueID
unsigned getVPValueID() const
Definition: VPlanValue.h:128
llvm::VPDef::~VPDef
virtual ~VPDef()
Definition: VPlanValue.h:389
llvm::VPUser::operands
const_operand_range operands() const
Definition: VPlanValue.h:296
llvm::VPValue::removeUser
void removeUser(VPUser &User)
Remove a single User from the list of users.
Definition: VPlanValue.h:142
llvm::VPValue::VPVWidenIntOrFpInductionSC
@ VPVWidenIntOrFpInductionSC
Definition: VPlanValue.h:111
llvm::VPValue::getDefiningRecipe
VPRecipeBase * getDefiningRecipe()
Returns the recipe defining this VPValue or nullptr if it is not defined by a recipe,...
Definition: VPlan.cpp:112
llvm::VPValue::VPValue
VPValue(Value *UV=nullptr, VPDef *Def=nullptr)
Definition: VPlanValue.h:118
llvm::VPValue::~VPValue
virtual ~VPValue()
Definition: VPlan.cpp:81
llvm::TinyPtrVector
TinyPtrVector - This class is specialized for cases where there are normally 0 or 1 element in a vect...
Definition: TinyPtrVector.h:30
llvm::VPValue::isDefinedOutsideVectorRegions
bool isDefinedOutsideVectorRegions() const
Returns true if the VPValue is defined outside any vector regions, i.e.
Definition: VPlanValue.h:210
llvm::VPDef::getVPDefID
unsigned getVPDefID() const
Definition: VPlanValue.h:434
llvm::VPValue::getUnderlyingValue
Value * getUnderlyingValue()
Return the underlying Value attached to this VPValue.
Definition: VPlanValue.h:84
llvm::VPValue::const_user_iterator
SmallVectorImpl< VPUser * >::const_iterator const_user_iterator
Definition: VPlanValue.h:158
llvm::VPlan
VPlan models a candidate for vectorization, encoding various decisions take to produce efficient outp...
Definition: VPlan.h:2492
llvm::Value
LLVM Value Representation.
Definition: Value.h:74
llvm::VPValue::printAsOperand
void printAsOperand(raw_ostream &OS, VPSlotTracker &Tracker) const
Definition: VPlan.cpp:1003
Other
Optional< std::vector< StOtherPiece > > Other
Definition: ELFYAML.cpp:1251
llvm::VPUser::const_operand_range
iterator_range< const_operand_iterator > const_operand_range
Definition: VPlanValue.h:289
llvm::VPValue::VPVBlendSC
@ VPVBlendSC
Definition: VPlanValue.h:104