|
LLVM 23.0.0git
|
The RecurrenceDescriptor is used to identify recurrences variables in a loop. More...
#include "llvm/Analysis/IVDescriptors.h"
Classes | |
| class | InstDesc |
| This POD struct holds information about a potential recurrence operation. More... | |
Public Member Functions | |
| RecurrenceDescriptor ()=default | |
| RecurrenceDescriptor (Value *Start, Instruction *Exit, StoreInst *Store, RecurKind K, FastMathFlags FMF, Instruction *ExactFP, Type *RT, bool Signed, bool Ordered, SmallPtrSetImpl< Instruction * > &CI, unsigned MinWidthCastToRecurTy, bool PhiHasUsesOutsideReductionChain=false) | |
| RecurrenceDescriptor (Value *Start, Instruction *Exit, StoreInst *Store, RecurKind K, FastMathFlags FMF, Instruction *ExactFP, Type *RT, bool IsMultiUse=false) | |
| Simpler constructor for min/max recurrences that don't track cast instructions. | |
| RecurKind | getRecurrenceKind () const |
| unsigned | getOpcode () const |
| FastMathFlags | getFastMathFlags () const |
| TrackingVH< Value > | getRecurrenceStartValue () const |
| Instruction * | getLoopExitInstr () const |
| bool | hasExactFPMath () const |
| Returns true if the recurrence has floating-point math that requires precise (ordered) operations. | |
| Instruction * | getExactFPMathInst () const |
| Returns 1st non-reassociative FP instruction in the PHI node's use-chain. | |
| 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. | |
| unsigned | getMinWidthCastToRecurrenceTypeInBits () const |
| Returns the minimum width used by the recurrence in bits. | |
| bool | isSigned () const |
| Returns true if all source operands of the recurrence are SExtInsts. | |
| bool | isOrdered () const |
| Expose an ordered FP reduction to the instance users. | |
| bool | hasUsesOutsideReductionChain () const |
| Returns true if the reduction PHI has any uses outside the reduction chain. | |
| LLVM_ABI 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 reductions instructions for in-loop reductions. | |
Static Public Member Functions | |
| static LLVM_ABI InstDesc | isRecurrenceInstr (Loop *L, PHINode *Phi, Instruction *I, RecurKind Kind, InstDesc &Prev, FastMathFlags FuncFMF, ScalarEvolution *SE) |
Returns a struct describing if the instruction 'I' can be a recurrence variable of type 'Kind' for a Loop L and reduction PHI Phi. | |
| static LLVM_ABI bool | hasMultipleUsesOf (Instruction *I, SmallPtrSetImpl< Instruction * > &Insts, unsigned MaxNumUses) |
| Returns true if instruction I has multiple uses in Insts. | |
| static LLVM_ABI bool | areAllUsesIn (Instruction *I, SmallPtrSetImpl< Instruction * > &Set) |
| Returns true if all uses of the instruction I is within the Set. | |
| static LLVM_ABI InstDesc | isAnyOfPattern (Loop *Loop, PHINode *OrigPhi, Instruction *I, InstDesc &Prev) |
| Returns a struct describing whether the instruction is either a Select(ICmp(A, B), X, Y), or Select(FCmp(A, B), X, Y) where one of (X, Y) is a loop invariant integer and the other is a PHI value. | |
| static LLVM_ABI InstDesc | isFindPattern (Loop *TheLoop, PHINode *OrigPhi, Instruction *I, ScalarEvolution &SE) |
| Returns a struct describing whether the instruction is either a Select(ICmp(A, B), X, Y), or Select(FCmp(A, B), X, Y) where one of (X, Y) is an increasing (FindLastIV) or decreasing (FindFirstIV) loop induction variable, or an arbitrary integer value (FindLast), and the other is a PHI value. | |
| static LLVM_ABI InstDesc | isConditionalRdxPattern (Instruction *I) |
| Returns a struct describing if the instruction is a Select(FCmp(X, Y), (Z = X op PHINode), PHINode) instruction pattern. | |
| static LLVM_ABI unsigned | getOpcode (RecurKind Kind) |
| Returns the opcode corresponding to the RecurrenceKind. | |
| static LLVM_ABI 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 LLVM_ABI 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. | |
| static LLVM_ABI bool | isFixedOrderRecurrence (PHINode *Phi, Loop *TheLoop, DominatorTree *DT) |
| Returns true if Phi is a fixed-order recurrence. | |
| static LLVM_ABI bool | isIntegerRecurrenceKind (RecurKind Kind) |
| Returns true if the recurrence kind is an integer kind. | |
| static LLVM_ABI bool | isFloatingPointRecurrenceKind (RecurKind Kind) |
| Returns true if the recurrence kind is a floating point kind. | |
| static bool | isIntMinMaxRecurrenceKind (RecurKind Kind) |
| Returns true if the recurrence kind is an integer min/max kind. | |
| static bool | isFPMinMaxNumRecurrenceKind (RecurKind Kind) |
| Returns true if the recurrence kind is a floating-point minnum/maxnum kind. | |
| static bool | isFPMinMaxRecurrenceKind (RecurKind Kind) |
| Returns true if the recurrence kind is a floating-point min/max kind. | |
| static bool | isMinMaxRecurrenceKind (RecurKind Kind) |
| Returns true if the recurrence kind is any min/max kind. | |
| static bool | isAnyOfRecurrenceKind (RecurKind Kind) |
| Returns true if the recurrence kind is of the form select(cmp(),x,y) where one of (x,y) is loop invariant. | |
| static bool | isFindIVRecurrenceKind (RecurKind Kind) |
| Returns true if the recurrence kind is of the form select(cmp(),x,y) where one of (x,y) is a loop induction variable. | |
| static bool | isFindLastRecurrenceKind (RecurKind Kind) |
| Returns true if the recurrence kind is of the form select(cmp(),x,y) where one of (x,y) is an arbitrary value and the other is a recurrence. | |
| static bool | isFindRecurrenceKind (RecurKind Kind) |
| static bool | isFMulAddIntrinsic (Instruction *I) |
| Returns true if the instruction is a call to the llvm.fmuladd intrinsic. | |
Public Attributes | |
| StoreInst * | IntermediateStore = nullptr |
| Reductions may store temporary or final result to an invariant address. | |
The RecurrenceDescriptor is used to identify recurrences variables in a loop.
Reduction is a special case of recurrence that has uses of the recurrence variable outside the loop. The method isReductionPHI identifies reductions that are basic recurrences.
Basic recurrences are defined as the summation, product, OR, AND, XOR, min, or max of a set of terms. For example: for(i=0; i<n; i++) { total += array[i]; } is a summation of array elements. Basic recurrences are a special case of chains of recurrences (CR). See ScalarEvolution for CR references. This struct holds information about recurrence variables.
Definition at line 85 of file IVDescriptors.h.
|
default |
Referenced by AddReductionVar(), and isReductionPHI().
|
inline |
Definition at line 89 of file IVDescriptors.h.
References assert(), IntermediateStore, isMinMaxRecurrenceKind(), and llvm::Signed.
|
inline |
Simpler constructor for min/max recurrences that don't track cast instructions.
Definition at line 108 of file IVDescriptors.h.
References IntermediateStore.
|
static |
Returns true if Phi is a reduction of type Kind and adds it to the RecurrenceDescriptor.
If either DB is non-null or AC and DT are non-null, the minimal bit width needed to compute the reduction will be computed.
Definition at line 439 of file IVDescriptors.cpp.
References llvm::SmallVectorImpl< T >::append(), areAllUsesIn(), assert(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::cast(), checkOrderedReduction(), collectCastInstrs(), collectMinMaxFMF(), computeRecurrenceType(), llvm::LoopBase< BlockT, LoopT >::contains(), llvm::SmallPtrSetImpl< PtrType >::count(), llvm::dbgs(), llvm::dyn_cast(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::FAdd, llvm::FindLast, llvm::FMul, llvm::RecurrenceDescriptor::InstDesc::getExactFPMathInst(), llvm::FastMathFlags::getFast(), llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::LoopBase< BlockT, LoopT >::getLoopPreheader(), llvm::User::getOperand(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm::RecurrenceDescriptor::InstDesc::getPatternInst(), llvm::RecurrenceDescriptor::InstDesc::getRecKind(), llvm::Type::getScalarType(), llvm::ScalarEvolution::getSCEV(), hasMultipleUsesOf(), llvm::SmallPtrSetImpl< PtrType >::insert(), IntermediateStore, llvm::is_contained(), llvm::isa(), isAnyOfPattern(), isAnyOfRecurrenceKind(), llvm::Instruction::isCommutative(), isConditionalRdxPattern(), isFindLastLikePhi(), isFloatingPointRecurrenceKind(), llvm::Type::isFloatingPointTy(), isFMulAddIntrinsic(), isIntegerRecurrenceKind(), llvm::Type::isIntegerTy(), llvm::ScalarEvolution::isLoopInvariant(), llvm::RecurrenceDescriptor::InstDesc::isRecurrence(), isRecurrenceInstr(), LLVM_DEBUG, lookThroughAnd(), llvm::None, llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), RecurrenceDescriptor(), llvm::Value::use_empty(), and llvm::Value::users().
Referenced by isReductionPHI().
|
static |
Returns true if all uses of the instruction I is within the Set.
Definition at line 33 of file IVDescriptors.cpp.
References llvm::dyn_cast(), and I.
Referenced by AddReductionVar().
|
inline |
Returns a reference to the instructions used for type-promoting the recurrence.
Definition at line 301 of file IVDescriptors.h.
Referenced by llvm::LoopVectorizationCostModel::collectValuesToIgnore().
|
inline |
Returns 1st non-reassociative FP instruction in the PHI node's use-chain.
Definition at line 239 of file IVDescriptors.h.
Referenced by checkReductionKind().
|
inline |
Definition at line 228 of file IVDescriptors.h.
Referenced by llvm::VPlanTransforms::createHeaderPhiRecipes(), llvm::LoopVectorizationCostModel::getReductionPatternCost(), and llvm::UnrollLoop().
|
inline |
Definition at line 232 of file IVDescriptors.h.
|
inline |
Returns the minimum width used by the recurrence in bits.
Definition at line 304 of file IVDescriptors.h.
Referenced by llvm::LoopVectorizationCostModel::getSmallestAndWidestTypes().
|
inline |
Definition at line 226 of file IVDescriptors.h.
References getOpcode(), and getRecurrenceKind().
Referenced by checkReductionKind(), llvm::VPExpressionRecipe::computeCost(), llvm::VPReductionRecipe::computeCost(), llvm::LoopVectorizationPlanner::emitInvalidCostRemarks(), getOpcode(), getReductionOpChain(), llvm::VPExpressionRecipe::printRecipe(), and tryToMatchAndCreateMulAccumulateReduction().
Returns the opcode corresponding to the RecurrenceKind.
Definition at line 1230 of file IVDescriptors.cpp.
References llvm::Add, llvm::AddChainWithSubs, llvm::And, llvm::AnyOf, llvm::FAdd, llvm::FindIV, llvm::FindLast, llvm::FMax, llvm::FMaximum, llvm::FMaximumNum, llvm::FMin, llvm::FMinimum, llvm::FMinimumNum, llvm::FMul, llvm::FMulAdd, llvm_unreachable, llvm::Mul, llvm::Or, llvm::SMax, llvm::SMin, llvm::Sub, llvm::UMax, llvm::UMin, and llvm::Xor.
Referenced by llvm::VPReductionEVLRecipe::execute(), llvm::VPReductionRecipe::execute(), llvm::LoopVectorizationCostModel::getReductionPatternCost(), llvm::VPIRFlags::printFlags(), llvm::VPExpressionRecipe::printRecipe(), llvm::VPReductionEVLRecipe::printRecipe(), llvm::VPReductionRecipe::printRecipe(), tryToMatchAndCreateExtendedReduction(), and llvm::UnrollLoop().
|
inline |
Definition at line 224 of file IVDescriptors.h.
Referenced by llvm::canParallelizeReductionWhenUnrolling(), checkReductionKind(), llvm::LoopVectorizationCostModel::collectElementTypesForWidening(), llvm::LoopVectorizationCostModel::collectInLoopReductions(), llvm::VPlanTransforms::createHeaderPhiRecipes(), getOpcode(), llvm::LoopVectorizationCostModel::getReductionPatternCost(), llvm::AArch64TTIImpl::isLegalToVectorizeReduction(), llvm::RISCVTTIImpl::isLegalToVectorizeReduction(), and llvm::UnrollLoop().
|
inline |
Definition at line 230 of file IVDescriptors.h.
Referenced by llvm::VPlanTransforms::createHeaderPhiRecipes().
|
inline |
Returns the type of the recurrence.
This type can be narrower than the actual type of the Phi if the recurrence has been type-promoted.
Definition at line 297 of file IVDescriptors.h.
Referenced by llvm::LoopVectorizationCostModel::collectElementTypesForWidening(), llvm::LoopVectorizationCostModel::collectInLoopReductions(), llvm::LoopVectorizationCostModel::getReductionPatternCost(), llvm::LoopVectorizationCostModel::getSmallestAndWidestTypes(), llvm::AArch64TTIImpl::isLegalToVectorizeReduction(), and llvm::RISCVTTIImpl::isLegalToVectorizeReduction().
| SmallVector< Instruction *, 4 > RecurrenceDescriptor::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 reductions instructions for in-loop reductions.
Definition at line 1273 of file IVDescriptors.cpp.
References llvm::AddChainWithSubs, llvm::cast(), llvm::dyn_cast(), getOpcode(), llvm::Value::hasNUses(), llvm::isa(), isFMulAddIntrinsic(), isMinMaxRecurrenceKind(), llvm::SelectPatternResult::isMinOrMax(), llvm::matchSelectPattern(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::Value::users().
Referenced by checkReductionKind(), and llvm::LoopVectorizationCostModel::collectInLoopReductions().
|
inline |
Returns true if the recurrence has floating-point math that requires precise (ordered) operations.
Definition at line 236 of file IVDescriptors.h.
Referenced by llvm::canParallelizeReductionWhenUnrolling(), and llvm::LoopVectorizationLegality::canVectorizeFPMath().
|
static |
Returns true if instruction I has multiple uses in Insts.
Definition at line 1039 of file IVDescriptors.cpp.
References llvm::SmallPtrSetImpl< PtrType >::count(), llvm::dyn_cast(), and I.
Referenced by AddReductionVar().
|
inline |
Returns true if the reduction PHI has any uses outside the reduction chain.
This is relevant for min/max reductions that are part of a FindIV pattern.
Definition at line 317 of file IVDescriptors.h.
Referenced by llvm::canParallelizeReductionWhenUnrolling(), llvm::LoopVectorizationCostModel::collectInLoopReductions(), and llvm::VPlanTransforms::createHeaderPhiRecipes().
|
static |
Returns a struct describing whether the instruction is either a Select(ICmp(A, B), X, Y), or Select(FCmp(A, B), X, Y) where one of (X, Y) is a loop invariant integer and the other is a PHI value.
Prev specifies the description of an already processed select instruction, so its corresponding cmp can be matched to it.
Definition at line 859 of file IVDescriptors.cpp.
References llvm::AnyOf, llvm::cast(), llvm::dyn_cast(), llvm::RecurrenceDescriptor::InstDesc::getRecKind(), I, llvm::Loop::isLoopInvariant(), llvm::PatternMatch::m_Cmp(), llvm::MIPatternMatch::m_OneUse(), llvm::PatternMatch::m_Select(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), and Select.
Referenced by AddReductionVar(), and isRecurrenceInstr().
Returns true if the recurrence kind is of the form select(cmp(),x,y) where one of (x,y) is loop invariant.
Definition at line 274 of file IVDescriptors.h.
References llvm::AnyOf.
Referenced by AddReductionVar(), llvm::canParallelizeReductionWhenUnrolling(), llvm::LoopVectorizationCostModel::collectInLoopReductions(), llvm::VPReductionRecipe::computeCost(), llvm::VPlanTransforms::createInLoopReductionRecipes(), llvm::createSimpleReduction(), llvm::VPReductionRecipe::execute(), llvm::LoopVectorizationCostModel::getInstructionCost(), and isRecurrenceInstr().
|
static |
Returns a struct describing if the instruction is a Select(FCmp(X, Y), (Z = X op PHINode), PHINode) instruction pattern.
Returns true if the select instruction has users in the compare-and-add reduction pattern below.
The select instruction argument is the last one in the sequence.
sum.1 = phi ... ... cmp = fcmp pred %0, CFP add = fadd %0, sum.1 sum.2 = select cmp, add, sum.1
Definition at line 952 of file IVDescriptors.cpp.
References llvm::dyn_cast(), I, llvm::isa(), llvm::PatternMatch::m_Add(), llvm::PatternMatch::m_Cmp(), llvm::PatternMatch::m_FAdd(), llvm::PatternMatch::m_FMul(), llvm::PatternMatch::m_FSub(), llvm::PatternMatch::m_Mul(), llvm::MIPatternMatch::m_OneUse(), llvm::PatternMatch::m_Select(), llvm::PatternMatch::m_Sub(), llvm::PatternMatch::m_Value(), and llvm::PatternMatch::match().
Referenced by AddReductionVar(), and isRecurrenceInstr().
Returns true if the recurrence kind is of the form select(cmp(),x,y) where one of (x,y) is a loop induction variable.
Definition at line 280 of file IVDescriptors.h.
References llvm::FindIV.
Referenced by llvm::LoopVectorizationCostModel::collectInLoopReductions(), llvm::VPlanTransforms::createInLoopReductionRecipes(), llvm::VPlanTransforms::handleMultiUseReductions(), and isFindRecurrenceKind().
Returns true if the recurrence kind is of the form select(cmp(),x,y) where one of (x,y) is an arbitrary value and the other is a recurrence.
Definition at line 287 of file IVDescriptors.h.
References llvm::FindLast.
Referenced by llvm::LoopVectorizationCostModel::collectInLoopReductions(), llvm::VPlanTransforms::createInLoopReductionRecipes(), llvm::VPlanTransforms::handleFindLastReductions(), isFindRecurrenceKind(), llvm::VPlanTransforms::optimizeFindIVReductions(), and llvm::LoopVectorizationCostModel::usePredicatedReductionSelect().
|
static |
Returns a struct describing whether the instruction is either a Select(ICmp(A, B), X, Y), or Select(FCmp(A, B), X, Y) where one of (X, Y) is an increasing (FindLastIV) or decreasing (FindFirstIV) loop induction variable, or an arbitrary integer value (FindLast), and the other is a PHI value.
Definition at line 919 of file IVDescriptors.cpp.
References llvm::FindLast, llvm::Value::hasOneUse(), I, llvm::PatternMatch::m_Cmp(), llvm::PatternMatch::m_CombineOr(), llvm::MIPatternMatch::m_OneUse(), llvm::PatternMatch::m_Select(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Value(), and llvm::PatternMatch::match().
Referenced by isRecurrenceInstr().
Definition at line 291 of file IVDescriptors.h.
References isFindIVRecurrenceKind(), and isFindLastRecurrenceKind().
Referenced by llvm::canParallelizeReductionWhenUnrolling(), llvm::createSimpleReduction(), and isRecurrenceInstr().
|
static |
Returns true if Phi is a fixed-order recurrence.
A fixed-order recurrence is a non-reduction recurrence relation in which the value of the recurrence in the current loop iteration equals a value defined in a previous iteration (e.g. if the value is defined in the previous iteration, we refer to it as first-order recurrence, if it is defined in the iteration before the previous, we refer to it as second-order recurrence and so on). Note that this function optimistically assumes that uses of the recurrence can be re-ordered if necessary and users need to check and perform the re-ordering.
Definition at line 1142 of file IVDescriptors.cpp.
References llvm::cast(), llvm::LoopBase< BlockT, LoopT >::contains(), llvm::DominatorTree::dominates(), llvm::dyn_cast(), llvm::dyn_cast_or_null(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::LoopBase< BlockT, LoopT >::getLoopLatch(), llvm::LoopBase< BlockT, LoopT >::getLoopPreheader(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::isa(), llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::Value::users().
Returns true if the recurrence kind is a floating point kind.
Definition at line 65 of file IVDescriptors.cpp.
References isIntegerRecurrenceKind(), and llvm::None.
Referenced by AddReductionVar(), and llvm::VPlanTransforms::createInLoopReductionRecipes().
|
inlinestatic |
Returns true if the instruction is a call to the llvm.fmuladd intrinsic.
Definition at line 327 of file IVDescriptors.h.
References llvm::cast(), I, and llvm::isa().
Referenced by AddReductionVar(), checkOrderedReduction(), llvm::VPlanTransforms::createInLoopReductionRecipes(), getReductionOpChain(), llvm::LoopVectorizationCostModel::getVectorCallCost(), isRecurrenceInstr(), and llvm::LoopVectorizationCostModel::setVectorizedCallDecision().
Returns true if the recurrence kind is a floating-point minnum/maxnum kind.
Definition at line 255 of file IVDescriptors.h.
References llvm::FMaxNum, and llvm::FMinNum.
Referenced by llvm::VPlanTransforms::handleMaxMinNumReductions(), and isFPMinMaxRecurrenceKind().
Returns true if the recurrence kind is a floating-point min/max kind.
Definition at line 260 of file IVDescriptors.h.
References llvm::FMax, llvm::FMaximum, llvm::FMaximumNum, llvm::FMin, llvm::FMinimum, llvm::FMinimumNum, and isFPMinMaxNumRecurrenceKind().
Referenced by getMinMaxRecurrence(), and isMinMaxRecurrenceKind().
Returns true if the recurrence kind is an integer kind.
Definition at line 41 of file IVDescriptors.cpp.
References llvm::Add, llvm::AddChainWithSubs, llvm::And, llvm::AnyOf, llvm::FindIV, llvm::FindLast, llvm::Mul, llvm::Or, llvm::SMax, llvm::SMin, llvm::Sub, llvm::UMax, llvm::UMin, and llvm::Xor.
Referenced by AddReductionVar(), and isFloatingPointRecurrenceKind().
Returns true if the recurrence kind is an integer min/max kind.
Definition at line 248 of file IVDescriptors.h.
References llvm::SMax, llvm::SMin, llvm::UMax, and llvm::UMin.
Referenced by getMinMaxRecurrence(), llvm::VPlanTransforms::handleMultiUseReductions(), and isMinMaxRecurrenceKind().
Returns true if the recurrence kind is any min/max kind.
Definition at line 268 of file IVDescriptors.h.
References isFPMinMaxRecurrenceKind(), and isIntMinMaxRecurrenceKind().
Referenced by llvm::canParallelizeReductionWhenUnrolling(), llvm::VPReductionRecipe::computeCost(), llvm::VPlanTransforms::createInLoopReductionRecipes(), llvm::VPReductionEVLRecipe::execute(), llvm::VPReductionRecipe::execute(), llvm::getOrderedReduction(), getReductionOpChain(), llvm::LoopVectorizationCostModel::getReductionPatternCost(), llvm::getShuffleReduction(), isReductionPHI(), and RecurrenceDescriptor().
|
inline |
Expose an ordered FP reduction to the instance users.
Definition at line 312 of file IVDescriptors.h.
Referenced by llvm::LoopVectorizationLegality::canVectorizeFPMath(), llvm::VPlanTransforms::createHeaderPhiRecipes(), and llvm::LoopVectorizationCostModel::useOrderedReductions().
|
static |
Returns a struct describing if the instruction 'I' can be a recurrence variable of type 'Kind' for a Loop L and reduction PHI Phi.
If the recurrence is a min/max pattern of select(icmp()) this function advances the instruction pointer 'I' from the compare instruction to the select instruction and stores this pointer in 'PatternLastInst' member of the returned struct.
Definition at line 988 of file IVDescriptors.cpp.
References llvm::Add, llvm::AddChainWithSubs, llvm::And, assert(), llvm::FAdd, llvm::FMul, llvm::FMulAdd, llvm::RecurrenceDescriptor::InstDesc::getExactFPMathInst(), llvm::RecurrenceDescriptor::InstDesc::getRecKind(), I, isAnyOfPattern(), isAnyOfRecurrenceKind(), isConditionalRdxPattern(), isFindPattern(), isFindRecurrenceKind(), isFMulAddIntrinsic(), llvm::Mul, llvm::None, llvm::Or, llvm::Sub, and llvm::Xor.
Referenced by AddReductionVar().
|
static |
Returns true if Phi is a reduction in TheLoop.
The RecurrenceDescriptor is returned in RedDes. If either DB is non-null or AC and DT are non-null, the minimal bit width needed to compute the reduction will be computed. If SE is non-null, store instructions to loop invariant addresses are processed.
Definition at line 1053 of file IVDescriptors.cpp.
References llvm::Add, llvm::AddChainWithSubs, AddReductionVar(), llvm::And, llvm::AnyOf, assert(), llvm::dbgs(), F, llvm::FAdd, llvm::FindLast, llvm::FMul, llvm::FMulAdd, llvm::LoopBase< BlockT, LoopT >::getHeader(), getMinMaxRecurrence(), isMinMaxRecurrenceKind(), LLVM_DEBUG, llvm::Mul, llvm::None, llvm::Or, RecurrenceDescriptor(), llvm::FastMathFlags::setNoNaNs(), llvm::Sub, and llvm::Xor.
Referenced by llvm::canParallelizeReductionWhenUnrolling(), and checkReductionKind().
|
inline |
Returns true if all source operands of the recurrence are SExtInsts.
Definition at line 309 of file IVDescriptors.h.
| StoreInst* llvm::RecurrenceDescriptor::IntermediateStore = nullptr |
Reductions may store temporary or final result to an invariant address.
If there is such a store in the loop then, after successfull run of AddReductionVar method, this field will be assigned the last met store.
Definition at line 335 of file IVDescriptors.h.
Referenced by AddReductionVar(), llvm::canParallelizeReductionWhenUnrolling(), llvm::LoopVectorizationLegality::isInvariantAddressOfReduction(), llvm::LoopVectorizationLegality::isInvariantStoreOfReduction(), RecurrenceDescriptor(), and RecurrenceDescriptor().