LLVM  14.0.0git
VPlanTransforms.cpp
Go to the documentation of this file.
1 //===-- VPlanTransforms.cpp - Utility VPlan to VPlan transforms -----------===//
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 implements a set of utility VPlan to VPlan transformations.
11 ///
12 //===----------------------------------------------------------------------===//
13 
14 #include "VPlanTransforms.h"
16 
17 using namespace llvm;
18 
20  Loop *OrigLoop, VPlanPtr &Plan,
22  GetIntOrFpInductionDescriptor,
23  SmallPtrSetImpl<Instruction *> &DeadInstructions, ScalarEvolution &SE) {
24 
25  auto *TopRegion = cast<VPRegionBlock>(Plan->getEntry());
26  ReversePostOrderTraversal<VPBlockBase *> RPOT(TopRegion->getEntry());
27 
28  for (VPBlockBase *Base : RPOT) {
29  // Do not widen instructions in pre-header and exit blocks.
30  if (Base->getNumPredecessors() == 0 || Base->getNumSuccessors() == 0)
31  continue;
32 
33  VPBasicBlock *VPBB = Base->getEntryBasicBlock();
34  // Introduce each ingredient into VPlan.
35  for (VPRecipeBase &Ingredient : llvm::make_early_inc_range(*VPBB)) {
36  VPValue *VPV = Ingredient.getVPSingleValue();
37  Instruction *Inst = cast<Instruction>(VPV->getUnderlyingValue());
38  if (DeadInstructions.count(Inst)) {
39  VPValue DummyValue;
40  VPV->replaceAllUsesWith(&DummyValue);
41  Ingredient.eraseFromParent();
42  continue;
43  }
44 
45  VPRecipeBase *NewRecipe = nullptr;
46  if (auto *VPPhi = dyn_cast<VPWidenPHIRecipe>(&Ingredient)) {
47  auto *Phi = cast<PHINode>(VPPhi->getUnderlyingValue());
48  if (const auto *II = GetIntOrFpInductionDescriptor(Phi)) {
49  VPValue *Start = Plan->getOrAddVPValue(II->getStartValue());
50  NewRecipe = new VPWidenIntOrFpInductionRecipe(Phi, Start, *II);
51  } else {
52  Plan->addVPValue(Phi, VPPhi);
53  continue;
54  }
55  } else {
56  assert(isa<VPInstruction>(&Ingredient) &&
57  "only VPInstructions expected here");
58  assert(!isa<PHINode>(Inst) && "phis should be handled above");
59  // Create VPWidenMemoryInstructionRecipe for loads and stores.
60  if (LoadInst *Load = dyn_cast<LoadInst>(Inst)) {
61  NewRecipe = new VPWidenMemoryInstructionRecipe(
62  *Load, Plan->getOrAddVPValue(getLoadStorePointerOperand(Inst)),
63  nullptr /*Mask*/, false /*Consecutive*/, false /*Reverse*/);
64  } else if (StoreInst *Store = dyn_cast<StoreInst>(Inst)) {
65  NewRecipe = new VPWidenMemoryInstructionRecipe(
66  *Store, Plan->getOrAddVPValue(getLoadStorePointerOperand(Inst)),
67  Plan->getOrAddVPValue(Store->getValueOperand()), nullptr /*Mask*/,
68  false /*Consecutive*/, false /*Reverse*/);
69  } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Inst)) {
70  NewRecipe = new VPWidenGEPRecipe(
71  GEP, Plan->mapToVPValues(GEP->operands()), OrigLoop);
72  } else if (CallInst *CI = dyn_cast<CallInst>(Inst)) {
73  NewRecipe =
74  new VPWidenCallRecipe(*CI, Plan->mapToVPValues(CI->args()));
75  } else if (SelectInst *SI = dyn_cast<SelectInst>(Inst)) {
76  bool InvariantCond =
77  SE.isLoopInvariant(SE.getSCEV(SI->getOperand(0)), OrigLoop);
78  NewRecipe = new VPWidenSelectRecipe(
79  *SI, Plan->mapToVPValues(SI->operands()), InvariantCond);
80  } else {
81  NewRecipe =
82  new VPWidenRecipe(*Inst, Plan->mapToVPValues(Inst->operands()));
83  }
84  }
85 
86  NewRecipe->insertBefore(&Ingredient);
87  if (NewRecipe->getNumDefinedValues() == 1)
88  VPV->replaceAllUsesWith(NewRecipe->getVPSingleValue());
89  else
90  assert(NewRecipe->getNumDefinedValues() == 0 &&
91  "Only recpies with zero or one defined values expected");
92  Ingredient.eraseFromParent();
93  Plan->removeVPValueFor(Inst);
94  for (auto *Def : NewRecipe->definedValues()) {
95  Plan->addVPValue(Inst, Def);
96  }
97  }
98  }
99 }
100 
102  auto Iter = depth_first(
104  bool Changed = false;
105  // First, collect the operands of all predicated replicate recipes as seeds
106  // for sinking.
108  for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly<VPBasicBlock>(Iter)) {
109  for (auto &Recipe : *VPBB) {
110  auto *RepR = dyn_cast<VPReplicateRecipe>(&Recipe);
111  if (!RepR || !RepR->isPredicated())
112  continue;
113  for (VPValue *Op : RepR->operands())
114  WorkList.insert(std::make_pair(RepR->getParent(), Op));
115  }
116  }
117 
118  // Try to sink each replicate recipe in the worklist.
119  while (!WorkList.empty()) {
120  VPBasicBlock *SinkTo;
121  VPValue *C;
122  std::tie(SinkTo, C) = WorkList.pop_back_val();
123  auto *SinkCandidate = dyn_cast_or_null<VPReplicateRecipe>(C->Def);
124  if (!SinkCandidate || SinkCandidate->isUniform() ||
125  SinkCandidate->getParent() == SinkTo ||
126  SinkCandidate->mayHaveSideEffects() ||
127  SinkCandidate->mayReadOrWriteMemory())
128  continue;
129 
130  bool NeedsDuplicating = false;
131  // All recipe users of the sink candidate must be in the same block SinkTo
132  // or all users outside of SinkTo must be uniform-after-vectorization (
133  // i.e., only first lane is used) . In the latter case, we need to duplicate
134  // SinkCandidate. At the moment, we identify such UAV's by looking for the
135  // address operands of widened memory recipes.
136  auto CanSinkWithUser = [SinkTo, &NeedsDuplicating,
137  SinkCandidate](VPUser *U) {
138  auto *UI = dyn_cast<VPRecipeBase>(U);
139  if (!UI)
140  return false;
141  if (UI->getParent() == SinkTo)
142  return true;
143  auto *WidenI = dyn_cast<VPWidenMemoryInstructionRecipe>(UI);
144  if (WidenI && WidenI->getAddr() == SinkCandidate) {
145  NeedsDuplicating = true;
146  return true;
147  }
148  return false;
149  };
150  if (!all_of(SinkCandidate->users(), CanSinkWithUser))
151  continue;
152 
153  if (NeedsDuplicating) {
154  Instruction *I = cast<Instruction>(SinkCandidate->getUnderlyingValue());
155  auto *Clone =
156  new VPReplicateRecipe(I, SinkCandidate->operands(), true, false);
157  // TODO: add ".cloned" suffix to name of Clone's VPValue.
158 
159  Clone->insertBefore(SinkCandidate);
160  SmallVector<VPUser *, 4> Users(SinkCandidate->users());
161  for (auto *U : Users) {
162  auto *UI = cast<VPRecipeBase>(U);
163  if (UI->getParent() == SinkTo)
164  continue;
165 
166  for (unsigned Idx = 0; Idx != UI->getNumOperands(); Idx++) {
167  if (UI->getOperand(Idx) != SinkCandidate)
168  continue;
169  UI->setOperand(Idx, Clone);
170  }
171  }
172  }
173  SinkCandidate->moveBefore(*SinkTo, SinkTo->getFirstNonPhi());
174  for (VPValue *Op : SinkCandidate->operands())
175  WorkList.insert(std::make_pair(SinkTo, Op));
176  Changed = true;
177  }
178  return Changed;
179 }
180 
181 /// If \p R is a region with a VPBranchOnMaskRecipe in the entry block, return
182 /// the mask.
184  auto *EntryBB = dyn_cast<VPBasicBlock>(R->getEntry());
185  if (!EntryBB || EntryBB->size() != 1 ||
186  !isa<VPBranchOnMaskRecipe>(EntryBB->begin()))
187  return nullptr;
188 
189  return cast<VPBranchOnMaskRecipe>(&*EntryBB->begin())->getOperand(0);
190 }
191 
192 /// If \p R is a triangle region, return the 'then' block of the triangle.
194  auto *EntryBB = cast<VPBasicBlock>(R->getEntry());
195  if (EntryBB->getNumSuccessors() != 2)
196  return nullptr;
197 
198  auto *Succ0 = dyn_cast<VPBasicBlock>(EntryBB->getSuccessors()[0]);
199  auto *Succ1 = dyn_cast<VPBasicBlock>(EntryBB->getSuccessors()[1]);
200  if (!Succ0 || !Succ1)
201  return nullptr;
202 
203  if (Succ0->getNumSuccessors() + Succ1->getNumSuccessors() != 1)
204  return nullptr;
205  if (Succ0->getSingleSuccessor() == Succ1)
206  return Succ0;
207  if (Succ1->getSingleSuccessor() == Succ0)
208  return Succ1;
209  return nullptr;
210 }
211 
213  SetVector<VPRegionBlock *> DeletedRegions;
214  bool Changed = false;
215 
216  // Collect region blocks to process up-front, to avoid iterator invalidation
217  // issues while merging regions.
218  SmallVector<VPRegionBlock *, 8> CandidateRegions(
219  VPBlockUtils::blocksOnly<VPRegionBlock>(depth_first(
221 
222  // Check if Base is a predicated triangle, followed by an empty block,
223  // followed by another predicate triangle. If that's the case, move the
224  // recipes from the first to the second triangle.
225  for (VPRegionBlock *Region1 : CandidateRegions) {
226  if (DeletedRegions.contains(Region1))
227  continue;
228  auto *MiddleBasicBlock =
229  dyn_cast_or_null<VPBasicBlock>(Region1->getSingleSuccessor());
230  if (!MiddleBasicBlock || !MiddleBasicBlock->empty())
231  continue;
232 
233  auto *Region2 =
234  dyn_cast_or_null<VPRegionBlock>(MiddleBasicBlock->getSingleSuccessor());
235  if (!Region2)
236  continue;
237 
238  VPValue *Mask1 = getPredicatedMask(Region1);
239  VPValue *Mask2 = getPredicatedMask(Region2);
240  if (!Mask1 || Mask1 != Mask2)
241  continue;
242  VPBasicBlock *Then1 = getPredicatedThenBlock(Region1);
243  VPBasicBlock *Then2 = getPredicatedThenBlock(Region2);
244  if (!Then1 || !Then2)
245  continue;
246 
247  assert(Mask1 && Mask2 && "both region must have conditions");
248 
249  // Note: No fusion-preventing memory dependencies are expected in either
250  // region. Such dependencies should be rejected during earlier dependence
251  // checks, which guarantee accesses can be re-ordered for vectorization.
252  //
253  // Move recipes to the successor region.
254  for (VPRecipeBase &ToMove : make_early_inc_range(reverse(*Then1)))
255  ToMove.moveBefore(*Then2, Then2->getFirstNonPhi());
256 
257  auto *Merge1 = cast<VPBasicBlock>(Then1->getSingleSuccessor());
258  auto *Merge2 = cast<VPBasicBlock>(Then2->getSingleSuccessor());
259 
260  // Move VPPredInstPHIRecipes from the merge block to the successor region's
261  // merge block. Update all users inside the successor region to use the
262  // original values.
263  for (VPRecipeBase &Phi1ToMove : make_early_inc_range(reverse(*Merge1))) {
264  VPValue *PredInst1 =
265  cast<VPPredInstPHIRecipe>(&Phi1ToMove)->getOperand(0);
266  VPValue *Phi1ToMoveV = Phi1ToMove.getVPSingleValue();
267  SmallVector<VPUser *> Users(Phi1ToMoveV->users());
268  for (VPUser *U : Users) {
269  auto *UI = dyn_cast<VPRecipeBase>(U);
270  if (!UI || UI->getParent() != Then2)
271  continue;
272  for (unsigned I = 0, E = U->getNumOperands(); I != E; ++I) {
273  if (Phi1ToMoveV != U->getOperand(I))
274  continue;
275  U->setOperand(I, PredInst1);
276  }
277  }
278 
279  Phi1ToMove.moveBefore(*Merge2, Merge2->begin());
280  }
281 
282  // Finally, remove the first region.
283  for (VPBlockBase *Pred : make_early_inc_range(Region1->getPredecessors())) {
284  VPBlockUtils::disconnectBlocks(Pred, Region1);
285  VPBlockUtils::connectBlocks(Pred, MiddleBasicBlock);
286  }
287  VPBlockUtils::disconnectBlocks(Region1, MiddleBasicBlock);
288  DeletedRegions.insert(Region1);
289  }
290 
291  for (VPRegionBlock *ToDelete : DeletedRegions)
292  delete ToDelete;
293  return Changed;
294 }
295 
298  for (auto &Phi : Plan.getEntry()->getEntryBasicBlock()->phis()) {
299  auto *IV = dyn_cast<VPWidenIntOrFpInductionRecipe>(&Phi);
300  if (!IV || IV->getTruncInst())
301  continue;
302 
303  // Visit all casts connected to IV and in Casts. Collect them.
304  // remember them for removal.
305  auto &Casts = IV->getInductionDescriptor().getCastInsts();
306  VPValue *FindMyCast = IV;
307  for (Instruction *IRCast : reverse(Casts)) {
308  VPRecipeBase *FoundUserCast = nullptr;
309  for (auto *U : FindMyCast->users()) {
310  auto *UserCast = cast<VPRecipeBase>(U);
311  if (UserCast->getNumDefinedValues() == 1 &&
312  UserCast->getVPSingleValue()->getUnderlyingValue() == IRCast) {
313  FoundUserCast = UserCast;
314  break;
315  }
316  }
317  assert(FoundUserCast && "Missing a cast to remove");
318  CastsToRemove.emplace_back(FoundUserCast, IV);
319  FindMyCast = FoundUserCast->getVPSingleValue();
320  }
321  }
322  for (auto &E : CastsToRemove) {
323  E.first->getVPSingleValue()->replaceAllUsesWith(E.second);
324  E.first->eraseFromParent();
325  }
326 }
327 
329  VPCanonicalIVPHIRecipe *CanonicalIV = Plan.getCanonicalIV();
330  VPWidenCanonicalIVRecipe *WidenNewIV = nullptr;
331  for (VPUser *U : CanonicalIV->users()) {
332  WidenNewIV = dyn_cast<VPWidenCanonicalIVRecipe>(U);
333  if (WidenNewIV)
334  break;
335  }
336 
337  if (!WidenNewIV)
338  return;
339 
340  VPBasicBlock *HeaderVPBB = Plan.getVectorLoopRegion()->getEntryBasicBlock();
341  for (VPRecipeBase &Phi : HeaderVPBB->phis()) {
342  auto *WidenOriginalIV = dyn_cast<VPWidenIntOrFpInductionRecipe>(&Phi);
343 
344  // If the induction recipe is canonical and the types match, use it
345  // directly.
346  if (WidenOriginalIV && WidenOriginalIV->isCanonical() &&
347  WidenOriginalIV->getScalarType() == WidenNewIV->getScalarType()) {
348  WidenNewIV->replaceAllUsesWith(WidenOriginalIV);
349  WidenNewIV->eraseFromParent();
350  return;
351  }
352  }
353 }
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:22
llvm::VPlanTransforms::VPInstructionsToVPRecipes
static void VPInstructionsToVPRecipes(Loop *OrigLoop, VPlanPtr &Plan, function_ref< const InductionDescriptor *(PHINode *)> GetIntOrFpInductionDescriptor, SmallPtrSetImpl< Instruction * > &DeadInstructions, ScalarEvolution &SE)
Replaces the VPInstructions in Plan with corresponding widen recipes.
Definition: VPlanTransforms.cpp:19
llvm::tgtok::Def
@ Def
Definition: TGLexer.h:50
llvm::VPCanonicalIVPHIRecipe
Canonical scalar induction phi of the vector loop.
Definition: VPlan.h:1660
llvm::VPRecipeBase::eraseFromParent
iplist< VPRecipeBase >::iterator eraseFromParent()
This method unlinks 'this' from the containing basic block and deletes it.
Definition: VPlan.cpp:623
llvm::User::operands
op_range operands()
Definition: User.h:242
getPredicatedMask
VPValue * getPredicatedMask(VPRegionBlock *R)
If R is a region with a VPBranchOnMaskRecipe in the entry block, return the mask.
Definition: VPlanTransforms.cpp:183
llvm::VPBasicBlock
VPBasicBlock serves as the leaf of the Hierarchical Control-Flow Graph.
Definition: VPlan.h:1736
llvm::Loop
Represents a single loop in the control flow graph.
Definition: LoopInfo.h:530
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1176
llvm::VPDef::getVPSingleValue
VPValue * getVPSingleValue()
Returns the only VPValue defined by the VPDef.
Definition: VPlanValue.h:368
llvm::ScalarEvolution
The main scalar evolution driver.
Definition: ScalarEvolution.h:460
llvm::VPlan::getCanonicalIV
VPCanonicalIVPHIRecipe * getCanonicalIV()
Returns the canonical induction recipe of the vector loop.
Definition: VPlan.h:2399
llvm::VPlanPtr
std::unique_ptr< VPlan > VPlanPtr
Definition: VPlan.h:98
llvm::reverse
auto reverse(ContainerTy &&C, std::enable_if_t< has_rbegin< ContainerTy >::value > *=nullptr)
Definition: STLExtras.h:357
llvm::VPWidenCallRecipe
A recipe for widening Call instructions.
Definition: VPlan.h:929
llvm::VPValue::users
user_range users()
Definition: VPlanValue.h:161
llvm::VPReplicateRecipe
VPReplicateRecipe replicates a given instruction producing multiple scalar copies of the original sca...
Definition: VPlan.h:1445
llvm::VPBlockBase
VPBlockBase is the building block of the Hierarchical Control-Flow Graph.
Definition: VPlan.h:395
llvm::VPlanTransforms::removeRedundantCanonicalIVs
static void removeRedundantCanonicalIVs(VPlan &Plan)
Try to replace VPWidenCanonicalIVRecipes with a widened canonical IV recipe, if it exists.
Definition: VPlanTransforms.cpp:328
llvm::all_of
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1592
llvm::InductionDescriptor
A struct for saving information about induction variables.
Definition: IVDescriptors.h:306
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
llvm::Instruction
Definition: Instruction.h:45
llvm::VPValue::replaceAllUsesWith
void replaceAllUsesWith(VPValue *New)
Definition: VPlan.cpp:1542
llvm::VPValue
Definition: VPlanValue.h:44
llvm::VPWidenCanonicalIVRecipe
A Recipe for widening the canonical induction variable of the vector loop.
Definition: VPlan.h:1692
llvm::VPDef::getNumDefinedValues
unsigned getNumDefinedValues() const
Returns the number of values defined by the VPDef.
Definition: VPlanValue.h:395
llvm::SetVector::empty
bool empty() const
Determine if the SetVector is empty or not.
Definition: SetVector.h:71
llvm::VPRegionBlock
VPRegionBlock represents a collection of VPBasicBlocks and VPRegionBlocks which form a Single-Entry-S...
Definition: VPlan.h:1850
llvm::ScalarEvolution::getSCEV
const SCEV * getSCEV(Value *V)
Return a SCEV expression for the full generality of the specified expression.
Definition: ScalarEvolution.cpp:4339
llvm::function_ref
An efficient, type-erasing, non-owning reference to a callable.
Definition: STLFunctionalExtras.h:36
llvm::StoreInst
An instruction for storing to memory.
Definition: Instructions.h:309
llvm::SetVector::contains
bool contains(const key_type &key) const
Check if the SetVector contains the given key.
Definition: SetVector.h:208
llvm::VPWidenRecipe
VPWidenRecipe is a recipe for producing a copy of vector type its ingredient.
Definition: VPlan.h:901
llvm::VPlanTransforms::sinkScalarOperands
static bool sinkScalarOperands(VPlan &Plan)
Definition: VPlanTransforms.cpp:101
I
#define I(x, y, z)
Definition: MD5.cpp:58
llvm::VPBlockUtils::connectBlocks
static void connectBlocks(VPBlockBase *From, VPBlockBase *To)
Connect VPBlockBases From and To bi-directionally.
Definition: VPlan.h:2538
llvm::GetElementPtrInst
an instruction for type-safe pointer arithmetic to access elements of arrays and structs
Definition: Instructions.h:933
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:585
llvm::VPBlockUtils::disconnectBlocks
static void disconnectBlocks(VPBlockBase *From, VPBlockBase *To)
Disconnect VPBlockBases From and To bi-directionally.
Definition: VPlan.h:2549
llvm::VPlan::getEntry
VPBlockBase * getEntry()
Definition: VPlan.h:2275
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
VPlanTransforms.h
llvm::VPWidenIntOrFpInductionRecipe
A recipe for handling phi nodes of integer and floating-point inductions, producing their vector and ...
Definition: VPlan.h:1027
SI
StandardInstrumentations SI(Debug, VerifyEach)
llvm::VPWidenGEPRecipe
A recipe for handling GEP instructions.
Definition: VPlan.h:986
llvm::SelectInst
This class represents the LLVM 'select' instruction.
Definition: Instructions.h:1741
llvm::VPWidenMemoryInstructionRecipe
A Recipe for widening load/store operations.
Definition: VPlan.h:1574
llvm::VPWidenSelectRecipe
A recipe for widening select instructions.
Definition: VPlan.h:955
llvm::SmallPtrSetImpl::count
size_type count(ConstPtrType Ptr) const
count - Return 1 if the specified pointer is in the set, 0 otherwise.
Definition: SmallPtrSet.h:382
llvm::SetVector::insert
bool insert(const value_type &X)
Insert a new element into the SetVector.
Definition: SetVector.h:140
llvm::VPlan::getVectorLoopRegion
VPRegionBlock * getVectorLoopRegion()
Returns the VPRegionBlock of the vector loop.
Definition: VPlan.h:2394
getPredicatedThenBlock
static VPBasicBlock * getPredicatedThenBlock(VPRegionBlock *R)
If R is a triangle region, return the 'then' block of the triangle.
Definition: VPlanTransforms.cpp:193
llvm::VPBlockBase::getSingleSuccessor
VPBlockBase * getSingleSuccessor() const
Definition: VPlan.h:512
llvm::LoadInst
An instruction for reading from memory.
Definition: Instructions.h:180
llvm::VPBlockBase::getEntryBasicBlock
const VPBasicBlock * getEntryBasicBlock() const
Definition: VPlan.cpp:140
llvm::ScalarEvolution::isLoopInvariant
bool isLoopInvariant(const SCEV *S, const Loop *L)
Return true if the value of the given SCEV is unchanging in the specified loop.
Definition: ScalarEvolution.cpp:13036
llvm::depth_first
iterator_range< df_iterator< T > > depth_first(const T &G)
Definition: DepthFirstIterator.h:228
llvm::AMDGPU::SendMsg::Op
Op
Definition: SIDefines.h:325
llvm::VPRecipeBase
VPRecipeBase is a base class modeling a sequence of one or more output IR instructions.
Definition: VPlan.h:673
llvm::VPWidenCanonicalIVRecipe::getScalarType
const Type * getScalarType() const
Returns the scalar type of the induction.
Definition: VPlan.h:1727
llvm::ReversePostOrderTraversal
Definition: PostOrderIterator.h:290
llvm::SPII::Load
@ Load
Definition: SparcInstrInfo.h:32
llvm::VPUser
This class augments VPValue with operands which provide the inverse def-use edges from VPValue's user...
Definition: VPlanValue.h:205
llvm::VPlanTransforms::removeRedundantInductionCasts
static void removeRedundantInductionCasts(VPlan &Plan)
Remove redundant casts of inductions.
Definition: VPlanTransforms.cpp:296
llvm::SPII::Store
@ Store
Definition: SparcInstrInfo.h:33
PostOrderIterator.h
Users
iv Induction Variable Users
Definition: IVUsers.cpp:52
llvm::PHINode
Definition: Instructions.h:2657
llvm::VPDef::definedValues
ArrayRef< VPValue * > definedValues()
Returns an ArrayRef of the values defined by the VPDef.
Definition: VPlanValue.h:390
llvm::SmallPtrSetImpl< Instruction * >
llvm::getLoadStorePointerOperand
const Value * getLoadStorePointerOperand(const Value *V)
A helper function that returns the pointer operand of a load or store instruction.
Definition: Instructions.h:5319
llvm::CallInst
This class represents a function call, abstracting a target machine's calling convention.
Definition: Instructions.h:1478
GEP
Hexagon Common GEP
Definition: HexagonCommonGEP.cpp:172
llvm::VPBasicBlock::phis
iterator_range< iterator > phis()
Returns an iterator range over the PHI-like recipes in the block.
Definition: VPlan.h:1814
llvm::VPBasicBlock::getFirstNonPhi
iterator getFirstNonPhi()
Return the position of the first non-phi node recipe in the block.
Definition: VPlan.cpp:220
llvm::VPBlockRecursiveTraversalWrapper
Helper for GraphTraits specialization that traverses through VPRegionBlocks.
Definition: VPlan.h:2142
llvm::SetVector
A vector that has set insertion semantics.
Definition: SetVector.h:39
llvm::VPlanTransforms::mergeReplicateRegions
static bool mergeReplicateRegions(VPlan &Plan)
Definition: VPlanTransforms.cpp:212
llvm::VPValue::getUnderlyingValue
Value * getUnderlyingValue()
Return the underlying Value attached to this VPValue.
Definition: VPlanValue.h:84
llvm::VPlan
VPlan models a candidate for vectorization, encoding various decisions take to produce efficient outp...
Definition: VPlan.h:2198
llvm::SetVector::pop_back_val
LLVM_NODISCARD T pop_back_val()
Definition: SetVector.h:231
llvm::VPRecipeBase::insertBefore
void insertBefore(VPRecipeBase *InsertPos)
Insert an unlinked recipe into a basic block immediately before the specified recipe.
Definition: VPlan.cpp:601
llvm::sampleprof::Base
@ Base
Definition: Discriminator.h:58
llvm::SmallVectorImpl::emplace_back
reference emplace_back(ArgTypes &&... Args)
Definition: SmallVector.h:916