Interface that views SCEV expressions under a growing set of predicates.

Synopsis

Declared in <llvm/Analysis/ScalarEvolution.h>

class PredicatedScalarEvolution;

Description

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:

  • provides a simple interface for SCEV versioning.

  • guarantees that the order of transformations applied on a SCEV expression for a single Value is consistent across two different getSCEV calls. This means that, for example, once we've obtained an AddRec expression for a certain value through expression rewriting, we will continue to get an AddRec expression for that Value.

  • lowers the number of expression rewrites.

Member Functions

Name

Description

PredicatedScalarEvolution [constructor]

Constructors

addPredicate

Add Pred to the current predicate set.

addPredicates

Add every predicate in Preds to the current predicate set.

areAddRecsEqualWithPreds

Return true if AR1 and AR2 are equal under current and extra predicates.

getAsAddRec

Attempt to rewrite V as an AddRecExpr by adding SCEV predicates.

getBackedgeTakenCount

Get the (predicated) backedge count for the analyzed loop.

getPredicate

Return the current union of SCEV predicates.

getPredicatedSCEV

Return the rewritten SCEV for Expr under the current predicate.

getSCEV

Return the SCEV for V under the current predicate.

getSE

Returns the ScalarEvolution analysis used.

getSmallConstantMaxTripCount

Returns the upper bound of the loop trip count as a normal unsigned value, or 0 if the trip count is unknown.

getSymbolicMaxBackedgeTakenCount

Get the (predicated) symbolic max backedge count for the analyzed loop.

hasNoOverflow

Return true if V is known not to wrap under Flags.

print

Print the SCEV mappings done by this analysis to OS.

Non-Member Functions

Name

Description

getPtrStride

If the pointer has a constant stride return it in units of the access type size. If the pointer is loop‐invariant, return 0. Otherwise return std::nullopt.

getPtrStride

Overload of getPtrStride that stores no‐wrap predicates in PSE.

replaceSymbolicStrideSCEV

Return the SCEV corresponding to a pointer with the symbolic stride replaced with constant one, assuming the SCEV predicate associated with PSE is true.

Created with MrDocs