LLVM 20.0.0git
IVDescriptors.h
Go to the documentation of this file.
1//===- llvm/Analysis/IVDescriptors.h - IndVar Descriptors -------*- C++ -*-===//
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// This file "describes" induction and recurrence variables.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_ANALYSIS_IVDESCRIPTORS_H
14#define LLVM_ANALYSIS_IVDESCRIPTORS_H
15
19#include "llvm/IR/ValueHandle.h"
20
21namespace llvm {
22
23class AssumptionCache;
24class DemandedBits;
25class DominatorTree;
26class Loop;
27class PredicatedScalarEvolution;
28class ScalarEvolution;
29class SCEV;
30class StoreInst;
31
32/// These are the kinds of recurrences that we support.
33enum class RecurKind {
34 None, ///< Not a recurrence.
35 Add, ///< Sum of integers.
36 Mul, ///< Product of integers.
37 Or, ///< Bitwise or logical OR of integers.
38 And, ///< Bitwise or logical AND of integers.
39 Xor, ///< Bitwise or logical XOR of integers.
40 SMin, ///< Signed integer min implemented in terms of select(cmp()).
41 SMax, ///< Signed integer max implemented in terms of select(cmp()).
42 UMin, ///< Unsigned integer min implemented in terms of select(cmp()).
43 UMax, ///< Unsigned integer max implemented in terms of select(cmp()).
44 FAdd, ///< Sum of floats.
45 FMul, ///< Product of floats.
46 FMin, ///< FP min implemented in terms of select(cmp()).
47 FMax, ///< FP max implemented in terms of select(cmp()).
48 FMinimum, ///< FP min with llvm.minimum semantics
49 FMaximum, ///< FP max with llvm.maximum semantics
50 FMulAdd, ///< Sum of float products with llvm.fmuladd(a * b + sum).
51 IAnyOf, ///< Any_of reduction with select(icmp(),x,y) where one of (x,y) is
52 ///< loop invariant, and both x and y are integer type.
53 FAnyOf ///< Any_of reduction with select(fcmp(),x,y) where one of (x,y) is
54 ///< loop invariant, and both x and y are integer type.
55 // TODO: Any_of reduction need not be restricted to integer type only.
56};
57
58/// The RecurrenceDescriptor is used to identify recurrences variables in a
59/// loop. Reduction is a special case of recurrence that has uses of the
60/// recurrence variable outside the loop. The method isReductionPHI identifies
61/// reductions that are basic recurrences.
62///
63/// Basic recurrences are defined as the summation, product, OR, AND, XOR, min,
64/// or max of a set of terms. For example: for(i=0; i<n; i++) { total +=
65/// array[i]; } is a summation of array elements. Basic recurrences are a
66/// special case of chains of recurrences (CR). See ScalarEvolution for CR
67/// references.
68
69/// This struct holds information about recurrence variables.
71public:
73
75 RecurKind K, FastMathFlags FMF, Instruction *ExactFP,
76 Type *RT, bool Signed, bool Ordered,
78 unsigned MinWidthCastToRecurTy)
79 : IntermediateStore(Store), StartValue(Start), LoopExitInstr(Exit),
80 Kind(K), FMF(FMF), ExactFPMathInst(ExactFP), RecurrenceType(RT),
81 IsSigned(Signed), IsOrdered(Ordered),
82 MinWidthCastToRecurrenceType(MinWidthCastToRecurTy) {
83 CastInsts.insert(CI.begin(), CI.end());
84 }
85
86 /// This POD struct holds information about a potential recurrence operation.
87 class InstDesc {
88 public:
89 InstDesc(bool IsRecur, Instruction *I, Instruction *ExactFP = nullptr)
90 : IsRecurrence(IsRecur), PatternLastInst(I),
91 RecKind(RecurKind::None), ExactFPMathInst(ExactFP) {}
92
93 InstDesc(Instruction *I, RecurKind K, Instruction *ExactFP = nullptr)
94 : IsRecurrence(true), PatternLastInst(I), RecKind(K),
95 ExactFPMathInst(ExactFP) {}
96
97 bool isRecurrence() const { return IsRecurrence; }
98
99 bool needsExactFPMath() const { return ExactFPMathInst != nullptr; }
100
101 Instruction *getExactFPMathInst() const { return ExactFPMathInst; }
102
103 RecurKind getRecKind() const { return RecKind; }
104
105 Instruction *getPatternInst() const { return PatternLastInst; }
106
107 private:
108 // Is this instruction a recurrence candidate.
109 bool IsRecurrence;
110 // The last instruction in a min/max pattern (select of the select(icmp())
111 // pattern), or the current recurrence instruction otherwise.
112 Instruction *PatternLastInst;
113 // If this is a min/max pattern.
114 RecurKind RecKind;
115 // Recurrence does not allow floating-point reassociation.
116 Instruction *ExactFPMathInst;
117 };
118
119 /// Returns a struct describing if the instruction 'I' can be a recurrence
120 /// variable of type 'Kind' for a Loop \p L and reduction PHI \p Phi.
121 /// If the recurrence is a min/max pattern of select(icmp()) this function
122 /// advances the instruction pointer 'I' from the compare instruction to the
123 /// select instruction and stores this pointer in 'PatternLastInst' member of
124 /// the returned struct.
125 static InstDesc isRecurrenceInstr(Loop *L, PHINode *Phi, Instruction *I,
126 RecurKind Kind, InstDesc &Prev,
127 FastMathFlags FuncFMF);
128
129 /// Returns true if instruction I has multiple uses in Insts
130 static bool hasMultipleUsesOf(Instruction *I,
132 unsigned MaxNumUses);
133
134 /// Returns true if all uses of the instruction I is within the Set.
136
137 /// Returns a struct describing if the instruction is a llvm.(s/u)(min/max),
138 /// llvm.minnum/maxnum or a Select(ICmp(X, Y), X, Y) pair of instructions
139 /// corresponding to a min(X, Y) or max(X, Y), matching the recurrence kind \p
140 /// Kind. \p Prev specifies the description of an already processed select
141 /// instruction, so its corresponding cmp can be matched to it.
142 static InstDesc isMinMaxPattern(Instruction *I, RecurKind Kind,
143 const InstDesc &Prev);
144
145 /// Returns a struct describing whether the instruction is either a
146 /// Select(ICmp(A, B), X, Y), or
147 /// Select(FCmp(A, B), X, Y)
148 /// where one of (X, Y) is a loop invariant integer and the other is a PHI
149 /// value. \p Prev specifies the description of an already processed select
150 /// instruction, so its corresponding cmp can be matched to it.
151 static InstDesc isAnyOfPattern(Loop *Loop, PHINode *OrigPhi, Instruction *I,
152 InstDesc &Prev);
153
154 /// Returns a struct describing if the instruction is a
155 /// Select(FCmp(X, Y), (Z = X op PHINode), PHINode) instruction pattern.
156 static InstDesc isConditionalRdxPattern(RecurKind Kind, Instruction *I);
157
158 /// Returns identity corresponding to the RecurrenceKind.
160
161 /// Returns the opcode corresponding to the RecurrenceKind.
162 static unsigned getOpcode(RecurKind Kind);
163
164 /// Returns true if Phi is a reduction of type Kind and adds it to the
165 /// RecurrenceDescriptor. If either \p DB is non-null or \p AC and \p DT are
166 /// non-null, the minimal bit width needed to compute the reduction will be
167 /// computed.
168 static bool
169 AddReductionVar(PHINode *Phi, RecurKind Kind, Loop *TheLoop,
170 FastMathFlags FuncFMF, RecurrenceDescriptor &RedDes,
171 DemandedBits *DB = nullptr, AssumptionCache *AC = nullptr,
172 DominatorTree *DT = nullptr, ScalarEvolution *SE = nullptr);
173
174 /// Returns true if Phi is a reduction in TheLoop. The RecurrenceDescriptor
175 /// is returned in RedDes. If either \p DB is non-null or \p AC and \p DT are
176 /// non-null, the minimal bit width needed to compute the reduction will be
177 /// computed. If \p SE is non-null, store instructions to loop invariant
178 /// addresses are processed.
179 static bool
180 isReductionPHI(PHINode *Phi, Loop *TheLoop, RecurrenceDescriptor &RedDes,
181 DemandedBits *DB = nullptr, AssumptionCache *AC = nullptr,
182 DominatorTree *DT = nullptr, ScalarEvolution *SE = nullptr);
183
184 /// Returns true if Phi is a fixed-order recurrence. A fixed-order recurrence
185 /// is a non-reduction recurrence relation in which the value of the
186 /// recurrence in the current loop iteration equals a value defined in a
187 /// previous iteration (e.g. if the value is defined in the previous
188 /// iteration, we refer to it as first-order recurrence, if it is defined in
189 /// the iteration before the previous, we refer to it as second-order
190 /// recurrence and so on). Note that this function optimistically assumes that
191 /// uses of the recurrence can be re-ordered if necessary and users need to
192 /// check and perform the re-ordering.
193 static bool isFixedOrderRecurrence(PHINode *Phi, Loop *TheLoop,
194 DominatorTree *DT);
195
196 RecurKind getRecurrenceKind() const { return Kind; }
197
198 unsigned getOpcode() const { return getOpcode(getRecurrenceKind()); }
199
200 FastMathFlags getFastMathFlags() const { return FMF; }
201
202 TrackingVH<Value> getRecurrenceStartValue() const { return StartValue; }
203
204 Instruction *getLoopExitInstr() const { return LoopExitInstr; }
205
206 /// Returns true if the recurrence has floating-point math that requires
207 /// precise (ordered) operations.
208 bool hasExactFPMath() const { return ExactFPMathInst != nullptr; }
209
210 /// Returns 1st non-reassociative FP instruction in the PHI node's use-chain.
211 Instruction *getExactFPMathInst() const { return ExactFPMathInst; }
212
213 /// Returns true if the recurrence kind is an integer kind.
214 static bool isIntegerRecurrenceKind(RecurKind Kind);
215
216 /// Returns true if the recurrence kind is a floating point kind.
218
219 /// Returns true if the recurrence kind is an integer min/max kind.
221 return Kind == RecurKind::UMin || Kind == RecurKind::UMax ||
222 Kind == RecurKind::SMin || Kind == RecurKind::SMax;
223 }
224
225 /// Returns true if the recurrence kind is a floating-point min/max kind.
227 return Kind == RecurKind::FMin || Kind == RecurKind::FMax ||
228 Kind == RecurKind::FMinimum || Kind == RecurKind::FMaximum;
229 }
230
231 /// Returns true if the recurrence kind is any min/max kind.
234 }
235
236 /// Returns true if the recurrence kind is of the form
237 /// select(cmp(),x,y) where one of (x,y) is loop invariant.
239 return Kind == RecurKind::IAnyOf || Kind == RecurKind::FAnyOf;
240 }
241
242 /// Returns the type of the recurrence. This type can be narrower than the
243 /// actual type of the Phi if the recurrence has been type-promoted.
244 Type *getRecurrenceType() const { return RecurrenceType; }
245
246 /// Returns a reference to the instructions used for type-promoting the
247 /// recurrence.
248 const SmallPtrSet<Instruction *, 8> &getCastInsts() const { return CastInsts; }
249
250 /// Returns the minimum width used by the recurrence in bits.
252 return MinWidthCastToRecurrenceType;
253 }
254
255 /// Returns true if all source operands of the recurrence are SExtInsts.
256 bool isSigned() const { return IsSigned; }
257
258 /// Expose an ordered FP reduction to the instance users.
259 bool isOrdered() const { return IsOrdered; }
260
261 /// Attempts to find a chain of operations from Phi to LoopExitInst that can
262 /// be treated as a set of reductions instructions for in-loop reductions.
264 Loop *L) const;
265
266 /// Returns true if the instruction is a call to the llvm.fmuladd intrinsic.
268 return isa<IntrinsicInst>(I) &&
269 cast<IntrinsicInst>(I)->getIntrinsicID() == Intrinsic::fmuladd;
270 }
271
272 /// Reductions may store temporary or final result to an invariant address.
273 /// If there is such a store in the loop then, after successfull run of
274 /// AddReductionVar method, this field will be assigned the last met store.
276
277private:
278 // The starting value of the recurrence.
279 // It does not have to be zero!
280 TrackingVH<Value> StartValue;
281 // The instruction who's value is used outside the loop.
282 Instruction *LoopExitInstr = nullptr;
283 // The kind of the recurrence.
285 // The fast-math flags on the recurrent instructions. We propagate these
286 // fast-math flags into the vectorized FP instructions we generate.
287 FastMathFlags FMF;
288 // First instance of non-reassociative floating-point in the PHI's use-chain.
289 Instruction *ExactFPMathInst = nullptr;
290 // The type of the recurrence.
291 Type *RecurrenceType = nullptr;
292 // True if all source operands of the recurrence are SExtInsts.
293 bool IsSigned = false;
294 // True if this recurrence can be treated as an in-order reduction.
295 // Currently only a non-reassociative FAdd can be considered in-order,
296 // if it is also the only FAdd in the PHI's use chain.
297 bool IsOrdered = false;
298 // Instructions used for type-promoting the recurrence.
300 // The minimum width used by the recurrence.
301 unsigned MinWidthCastToRecurrenceType;
302};
303
304/// A struct for saving information about induction variables.
306public:
307 /// This enum represents the kinds of inductions that we support.
309 IK_NoInduction, ///< Not an induction variable.
310 IK_IntInduction, ///< Integer induction variable. Step = C.
311 IK_PtrInduction, ///< Pointer induction var. Step = C.
312 IK_FpInduction ///< Floating point induction variable.
313 };
314
315public:
316 /// Default constructor - creates an invalid induction.
318
319 Value *getStartValue() const { return StartValue; }
320 InductionKind getKind() const { return IK; }
321 const SCEV *getStep() const { return Step; }
322 BinaryOperator *getInductionBinOp() const { return InductionBinOp; }
324
325 /// Returns true if \p Phi is an induction in the loop \p L. If \p Phi is an
326 /// induction, the induction descriptor \p D will contain the data describing
327 /// this induction. Since Induction Phis can only be present inside loop
328 /// headers, the function will assert if it is passed a Phi whose parent is
329 /// not the loop header. If by some other means the caller has a better SCEV
330 /// expression for \p Phi than the one returned by the ScalarEvolution
331 /// analysis, it can be passed through \p Expr. If the def-use chain
332 /// associated with the phi includes casts (that we know we can ignore
333 /// under proper runtime checks), they are passed through \p CastsToIgnore.
334 static bool
335 isInductionPHI(PHINode *Phi, const Loop *L, ScalarEvolution *SE,
336 InductionDescriptor &D, const SCEV *Expr = nullptr,
337 SmallVectorImpl<Instruction *> *CastsToIgnore = nullptr);
338
339 /// Returns true if \p Phi is a floating point induction in the loop \p L.
340 /// If \p Phi is an induction, the induction descriptor \p D will contain
341 /// the data describing this induction.
342 static bool isFPInductionPHI(PHINode *Phi, const Loop *L, ScalarEvolution *SE,
344
345 /// Returns true if \p Phi is a loop \p L induction, in the context associated
346 /// with the run-time predicate of PSE. If \p Assume is true, this can add
347 /// further SCEV predicates to \p PSE in order to prove that \p Phi is an
348 /// induction.
349 /// If \p Phi is an induction, \p D will contain the data describing this
350 /// induction.
351 static bool isInductionPHI(PHINode *Phi, const Loop *L,
353 InductionDescriptor &D, bool Assume = false);
354
355 /// Returns floating-point induction operator that does not allow
356 /// reassociation (transforming the induction requires an override of normal
357 /// floating-point rules).
359 if (IK == IK_FpInduction && InductionBinOp &&
360 !InductionBinOp->hasAllowReassoc())
361 return InductionBinOp;
362 return nullptr;
363 }
364
365 /// Returns binary opcode of the induction operator.
367 return InductionBinOp ? InductionBinOp->getOpcode()
368 : Instruction::BinaryOpsEnd;
369 }
370
371 /// Returns a reference to the type cast instructions in the induction
372 /// update chain, that are redundant when guarded with a runtime
373 /// SCEV overflow check.
375 return RedundantCasts;
376 }
377
378private:
379 /// Private constructor - used by \c isInductionPHI.
380 InductionDescriptor(Value *Start, InductionKind K, const SCEV *Step,
381 BinaryOperator *InductionBinOp = nullptr,
382 SmallVectorImpl<Instruction *> *Casts = nullptr);
383
384 /// Start value.
385 TrackingVH<Value> StartValue;
386 /// Induction kind.
388 /// Step value.
389 const SCEV *Step = nullptr;
390 // Instruction that advances induction variable.
391 BinaryOperator *InductionBinOp = nullptr;
392 // Instructions used for type-casts of the induction variable,
393 // that are redundant when guarded with a runtime SCEV overflow check.
394 SmallVector<Instruction *, 2> RedundantCasts;
395};
396
397} // end namespace llvm
398
399#endif // LLVM_ANALYSIS_IVDESCRIPTORS_H
basic Basic Alias true
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
#define I(x, y, z)
Definition: MD5.cpp:58
This file defines the SmallPtrSet class.
This file defines the SmallVector class.
A cache of @llvm.assume calls within a function.
BinaryOps getOpcode() const
Definition: InstrTypes.h:442
This is the shared class of boolean and integer constants.
Definition: Constants.h:81
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
Definition: Dominators.h:162
Convenience struct for specifying and reasoning about fast-math flags.
Definition: FMF.h:20
A struct for saving information about induction variables.
BinaryOperator * getInductionBinOp() const
InductionKind getKind() const
const SCEV * getStep() const
InductionKind
This enum represents the kinds of inductions that we support.
@ IK_NoInduction
Not an induction variable.
@ IK_FpInduction
Floating point induction variable.
@ IK_PtrInduction
Pointer induction var. Step = C.
@ IK_IntInduction
Integer induction variable. Step = C.
static bool isInductionPHI(PHINode *Phi, const Loop *L, ScalarEvolution *SE, InductionDescriptor &D, const SCEV *Expr=nullptr, SmallVectorImpl< Instruction * > *CastsToIgnore=nullptr)
Returns true if Phi is an induction in the loop L.
static bool isFPInductionPHI(PHINode *Phi, const Loop *L, ScalarEvolution *SE, InductionDescriptor &D)
Returns true if Phi is a floating point induction in the loop L.
Instruction::BinaryOps getInductionOpcode() const
Returns binary opcode of the induction operator.
const SmallVectorImpl< Instruction * > & getCastInsts() const
Returns a reference to the type cast instructions in the induction update chain, that are redundant w...
Value * getStartValue() const
Instruction * getExactFPMathInst()
Returns floating-point induction operator that does not allow reassociation (transforming the inducti...
InductionDescriptor()=default
Default constructor - creates an invalid induction.
ConstantInt * getConstIntStepValue() const
bool hasAllowReassoc() const LLVM_READONLY
Determine whether the allow-reassociation flag is set.
Represents a single loop in the control flow graph.
Definition: LoopInfo.h:39
An interface layer with SCEV used to manage how we see SCEV expressions for values in the context of ...
This POD struct holds information about a potential recurrence operation.
Definition: IVDescriptors.h:87
InstDesc(bool IsRecur, Instruction *I, Instruction *ExactFP=nullptr)
Definition: IVDescriptors.h:89
Instruction * getPatternInst() const
InstDesc(Instruction *I, RecurKind K, Instruction *ExactFP=nullptr)
Definition: IVDescriptors.h:93
Instruction * getExactFPMathInst() const
The RecurrenceDescriptor is used to identify recurrences variables in a loop.
Definition: IVDescriptors.h:70
static bool isFPMinMaxRecurrenceKind(RecurKind Kind)
Returns true if the recurrence kind is a floating-point min/max kind.
Instruction * getExactFPMathInst() const
Returns 1st non-reassociative FP instruction in the PHI node's use-chain.
static bool isFMulAddIntrinsic(Instruction *I)
Returns true if the instruction is a call to the llvm.fmuladd intrinsic.
FastMathFlags getFastMathFlags() const
static bool isFixedOrderRecurrence(PHINode *Phi, Loop *TheLoop, DominatorTree *DT)
Returns true if Phi is a fixed-order recurrence.
bool hasExactFPMath() const
Returns true if the recurrence has floating-point math that requires precise (ordered) operations.
Instruction * getLoopExitInstr() const
unsigned getOpcode() const
static bool hasMultipleUsesOf(Instruction *I, SmallPtrSetImpl< Instruction * > &Insts, unsigned MaxNumUses)
Returns true if instruction I has multiple uses in Insts.
static bool isReductionPHI(PHINode *Phi, Loop *TheLoop, RecurrenceDescriptor &RedDes, DemandedBits *DB=nullptr, AssumptionCache *AC=nullptr, DominatorTree *DT=nullptr, ScalarEvolution *SE=nullptr)
Returns true if Phi is a reduction in TheLoop.
RecurrenceDescriptor(Value *Start, Instruction *Exit, StoreInst *Store, RecurKind K, FastMathFlags FMF, Instruction *ExactFP, Type *RT, bool Signed, bool Ordered, SmallPtrSetImpl< Instruction * > &CI, unsigned MinWidthCastToRecurTy)
Definition: IVDescriptors.h:74
Type * getRecurrenceType() const
Returns the type of the recurrence.
const SmallPtrSet< Instruction *, 8 > & getCastInsts() const
Returns a reference to the instructions used for type-promoting the recurrence.
static bool areAllUsesIn(Instruction *I, SmallPtrSetImpl< Instruction * > &Set)
Returns true if all uses of the instruction I is within the Set.
unsigned getMinWidthCastToRecurrenceTypeInBits() const
Returns the minimum width used by the recurrence in bits.
TrackingVH< Value > getRecurrenceStartValue() const
SmallVector< Instruction *, 4 > getReductionOpChain(PHINode *Phi, Loop *L) const
Attempts to find a chain of operations from Phi to LoopExitInst that can be treated as a set of reduc...
static bool isAnyOfRecurrenceKind(RecurKind Kind)
Returns true if the recurrence kind is of the form select(cmp(),x,y) where one of (x,...
static InstDesc isAnyOfPattern(Loop *Loop, PHINode *OrigPhi, Instruction *I, InstDesc &Prev)
Returns a struct describing whether the instruction is either a Select(ICmp(A, B),...
bool isSigned() const
Returns true if all source operands of the recurrence are SExtInsts.
static InstDesc isConditionalRdxPattern(RecurKind Kind, Instruction *I)
Returns a struct describing if the instruction is a Select(FCmp(X, Y), (Z = X op PHINode),...
RecurKind getRecurrenceKind() const
bool isOrdered() const
Expose an ordered FP reduction to the instance users.
Value * getRecurrenceIdentity(RecurKind K, Type *Tp, FastMathFlags FMF) const
Returns identity corresponding to the RecurrenceKind.
StoreInst * IntermediateStore
Reductions may store temporary or final result to an invariant address.
static bool isFloatingPointRecurrenceKind(RecurKind Kind)
Returns true if the recurrence kind is a floating point kind.
static InstDesc isRecurrenceInstr(Loop *L, PHINode *Phi, Instruction *I, RecurKind Kind, InstDesc &Prev, FastMathFlags FuncFMF)
Returns a struct describing if the instruction 'I' can be a recurrence variable of type 'Kind' for a ...
static InstDesc isMinMaxPattern(Instruction *I, RecurKind Kind, const InstDesc &Prev)
Returns a struct describing if the instruction is a llvm.
static bool AddReductionVar(PHINode *Phi, RecurKind Kind, Loop *TheLoop, FastMathFlags FuncFMF, RecurrenceDescriptor &RedDes, DemandedBits *DB=nullptr, AssumptionCache *AC=nullptr, DominatorTree *DT=nullptr, ScalarEvolution *SE=nullptr)
Returns true if Phi is a reduction of type Kind and adds it to the RecurrenceDescriptor.
static bool isIntegerRecurrenceKind(RecurKind Kind)
Returns true if the recurrence kind is an integer kind.
static bool isIntMinMaxRecurrenceKind(RecurKind Kind)
Returns true if the recurrence kind is an integer min/max kind.
static bool isMinMaxRecurrenceKind(RecurKind Kind)
Returns true if the recurrence kind is any min/max kind.
This class represents an analyzed expression in the program.
The main scalar evolution driver.
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
Definition: SmallPtrSet.h:346
iterator end() const
Definition: SmallPtrSet.h:460
iterator begin() const
Definition: SmallPtrSet.h:455
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
Definition: SmallPtrSet.h:502
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: SmallVector.h:586
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1209
An instruction for storing to memory.
Definition: Instructions.h:290
Value handle that tracks a Value across RAUW.
Definition: ValueHandle.h:331
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
LLVM Value Representation.
Definition: Value.h:74
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
@ None
Definition: CodeGenData.h:101
RecurKind
These are the kinds of recurrences that we support.
Definition: IVDescriptors.h:33
@ UMin
Unsigned integer min implemented in terms of select(cmp()).
@ FAnyOf
Any_of reduction with select(fcmp(),x,y) where one of (x,y) is loop invariant, and both x and y are i...
@ Or
Bitwise or logical OR of integers.
@ FMinimum
FP min with llvm.minimum semantics.
@ Mul
Product of integers.
@ None
Not a recurrence.
@ Xor
Bitwise or logical XOR of integers.
@ FMax
FP max implemented in terms of select(cmp()).
@ FMaximum
FP max with llvm.maximum semantics.
@ FMulAdd
Sum of float products with llvm.fmuladd(a * b + sum).
@ FMul
Product of floats.
@ SMax
Signed integer max implemented in terms of select(cmp()).
@ And
Bitwise or logical AND of integers.
@ SMin
Signed integer min implemented in terms of select(cmp()).
@ FMin
FP min implemented in terms of select(cmp()).
@ Add
Sum of integers.
@ FAdd
Sum of floats.
@ IAnyOf
Any_of reduction with select(icmp(),x,y) where one of (x,y) is loop invariant, and both x and y are i...
@ UMax
Unsigned integer max implemented in terms of select(cmp()).