|
LLVM 22.0.0git
|
An interface layer with SCEV used to manage how we see SCEV expressions for values in the context of existing predicates. More...
#include "llvm/Analysis/ScalarEvolution.h"
Public Member Functions | |
| LLVM_ABI | PredicatedScalarEvolution (ScalarEvolution &SE, Loop &L) |
| LLVM_ABI const SCEVPredicate & | getPredicate () const |
| LLVM_ABI const SCEV * | getSCEV (Value *V) |
| Returns the SCEV expression of V, in the context of the current SCEV predicate. | |
| LLVM_ABI const SCEV * | getPredicatedSCEV (const SCEV *Expr) |
Returns the rewritten SCEV for Expr in the context of the current SCEV predicate. | |
| LLVM_ABI const SCEV * | getBackedgeTakenCount () |
| Get the (predicated) backedge count for the analyzed loop. | |
| LLVM_ABI const SCEV * | getSymbolicMaxBackedgeTakenCount () |
| Get the (predicated) symbolic max backedge count for the analyzed loop. | |
| LLVM_ABI unsigned | getSmallConstantMaxTripCount () |
| Returns the upper bound of the loop trip count as a normal unsigned value, or 0 if the trip count is unknown. | |
| LLVM_ABI void | addPredicate (const SCEVPredicate &Pred) |
| Adds a new predicate. | |
| LLVM_ABI const SCEVAddRecExpr * | getAsAddRec (Value *V) |
| Attempts to produce an AddRecExpr for V by adding additional SCEV predicates. | |
| LLVM_ABI void | setNoOverflow (Value *V, SCEVWrapPredicate::IncrementWrapFlags Flags) |
| Proves that V doesn't overflow by adding SCEV predicate. | |
| LLVM_ABI bool | hasNoOverflow (Value *V, SCEVWrapPredicate::IncrementWrapFlags Flags) |
| Returns true if we've proved that V doesn't wrap by means of a SCEV predicate. | |
| ScalarEvolution * | getSE () const |
| Returns the ScalarEvolution analysis used. | |
| LLVM_ABI | PredicatedScalarEvolution (const PredicatedScalarEvolution &) |
| We need to explicitly define the copy constructor because of FlagsMap. | |
| LLVM_ABI void | print (raw_ostream &OS, unsigned Depth) const |
| Print the SCEV mappings done by the Predicated Scalar Evolution. | |
| LLVM_ABI bool | areAddRecsEqualWithPreds (const SCEVAddRecExpr *AR1, const SCEVAddRecExpr *AR2) const |
Check if AR1 and AR2 are equal, while taking into account Equal predicates in Preds. | |
An interface layer with SCEV used to manage how we see SCEV expressions for values in the context of existing predicates.
We can add new predicates, but we cannot remove them.
This layer has multiple purposes:
Definition at line 2442 of file ScalarEvolution.h.
| PredicatedScalarEvolution::PredicatedScalarEvolution | ( | ScalarEvolution & | SE, |
| Loop & | L ) |
Definition at line 15262 of file ScalarEvolution.cpp.
References DenseMapInfo< LocallyHashedType >::Empty.
Referenced by PredicatedScalarEvolution().
| PredicatedScalarEvolution::PredicatedScalarEvolution | ( | const PredicatedScalarEvolution & | Init | ) |
We need to explicitly define the copy constructor because of FlagsMap.
Definition at line 15404 of file ScalarEvolution.cpp.
References I, and PredicatedScalarEvolution().
| void PredicatedScalarEvolution::addPredicate | ( | const SCEVPredicate & | Pred | ) |
Adds a new predicate.
Definition at line 15333 of file ScalarEvolution.cpp.
References llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by getAsAddRec(), getBackedgeTakenCount(), getSmallConstantMaxTripCount(), getSymbolicMaxBackedgeTakenCount(), llvm::replaceSymbolicStrideSCEV(), and setNoOverflow().
| bool PredicatedScalarEvolution::areAddRecsEqualWithPreds | ( | const SCEVAddRecExpr * | AR1, |
| const SCEVAddRecExpr * | AR2 ) const |
Check if AR1 and AR2 are equal, while taking into account Equal predicates in Preds.
Definition at line 5746 of file ScalarEvolution.cpp.
References llvm::SCEVAddRecExpr::getStart(), and llvm::SCEVAddRecExpr::getStepRecurrence().
Referenced by getCastsForInductionPHI().
| const SCEVAddRecExpr * PredicatedScalarEvolution::getAsAddRec | ( | Value * | V | ) |
Attempts to produce an AddRecExpr for V by adding additional SCEV predicates.
If we can't transform the expression into an AddRecExpr we return nullptr and not add additional SCEV predicates to the current context.
Definition at line 15389 of file ScalarEvolution.cpp.
References addPredicate(), getSCEV(), and P.
Referenced by llvm::getPtrStride(), and llvm::InductionDescriptor::isInductionPHI().
Get the (predicated) backedge count for the analyzed loop.
Definition at line 15302 of file ScalarEvolution.cpp.
References addPredicate(), and P.
Referenced by llvm::RuntimePointerChecking::insert(), and processLoopInVPlanNativePath().
| const SCEVPredicate & PredicatedScalarEvolution::getPredicate | ( | ) | const |
Definition at line 15343 of file ScalarEvolution.cpp.
Referenced by llvm::LoopVectorizePass::processLoop().
Returns the rewritten SCEV for Expr in the context of the current SCEV predicate.
The order of transformations applied on the expression of Expr returned by ScalarEvolution is guaranteed to be preserved, even when adding new predicates.
Definition at line 15284 of file ScalarEvolution.cpp.
Referenced by getSCEV(), and llvm::vputils::getSCEVExprForVPValue().
Returns the SCEV expression of V, in the context of the current SCEV predicate.
The order of transformations applied on the expression of V returned by ScalarEvolution is guaranteed to be preserved, even when adding new predicates.
Definition at line 15279 of file ScalarEvolution.cpp.
References getPredicatedSCEV().
Referenced by getAddressAccessSCEV(), getAsAddRec(), getCastsForInductionPHI(), hasNoOverflow(), llvm::InductionDescriptor::isInductionPHI(), llvm::VPlanTransforms::replaceSymbolicStrides(), llvm::replaceSymbolicStrideSCEV(), and setNoOverflow().
|
inline |
Returns the ScalarEvolution analysis used.
Definition at line 2489 of file ScalarEvolution.h.
Referenced by addInitialSkeleton(), llvm::VPlanTransforms::addMinimumIterationCheck(), canTailPredicateLoop(), createWidenInductionRecipe(), llvm::findHistogram(), getAddressAccessSCEV(), getAddressAccessSCEV(), getOptimizableIVOf(), llvm::getPtrStride(), llvm::vputils::getSCEVExprForVPValue(), getSmallBestKnownTC(), getStrideFromAddRec(), llvm::RuntimePointerChecking::insert(), isConditionTrueViaVFAndUF(), llvm::InductionDescriptor::isInductionPHI(), llvm::VPlanTransforms::materializeConstantVectorTripCount(), llvm::LoopVectorizePass::processLoop(), llvm::VPlanTransforms::replaceSymbolicStrides(), llvm::replaceSymbolicStrideSCEV(), simplifyBranchConditionForVFAndUF(), and simplifyKnownEVL().
| unsigned PredicatedScalarEvolution::getSmallConstantMaxTripCount | ( | ) |
Returns the upper bound of the loop trip count as a normal unsigned value, or 0 if the trip count is unknown.
Definition at line 15323 of file ScalarEvolution.cpp.
References addPredicate(), and P.
Referenced by getSmallBestKnownTC().
Get the (predicated) symbolic max backedge count for the analyzed loop.
Definition at line 15312 of file ScalarEvolution.cpp.
References addPredicate(), and P.
Referenced by addInitialSkeleton(), and llvm::RuntimePointerChecking::insert().
| bool PredicatedScalarEvolution::hasNoOverflow | ( | Value * | V, |
| SCEVWrapPredicate::IncrementWrapFlags | Flags ) |
Returns true if we've proved that V doesn't wrap by means of a SCEV predicate.
Definition at line 15373 of file ScalarEvolution.cpp.
References llvm::cast(), llvm::SCEVWrapPredicate::clearFlags(), llvm::SCEVWrapPredicate::getImpliedFlags(), getSCEV(), II, and llvm::SCEVWrapPredicate::IncrementAnyWrap.
Referenced by isNoWrap().
| void PredicatedScalarEvolution::print | ( | raw_ostream & | OS, |
| unsigned | Depth ) const |
Print the SCEV mappings done by the Predicated Scalar Evolution.
The printed text is indented by Depth.
Definition at line 15414 of file ScalarEvolution.cpp.
References llvm::Depth, I, II, and llvm::raw_ostream::indent().
| void PredicatedScalarEvolution::setNoOverflow | ( | Value * | V, |
| SCEVWrapPredicate::IncrementWrapFlags | Flags ) |
Proves that V doesn't overflow by adding SCEV predicate.
Definition at line 15357 of file ScalarEvolution.cpp.
References addPredicate(), llvm::cast(), llvm::SCEVWrapPredicate::clearFlags(), llvm::SCEVWrapPredicate::getImpliedFlags(), getSCEV(), II, and llvm::SCEVWrapPredicate::setFlags().
Referenced by isNoWrap().