class PredicatedScalarEvolution

Declaration

class PredicatedScalarEvolution { /* full declaration omitted */ };

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.

Declared at: llvm/include/llvm/Analysis/ScalarEvolution.h:1974

Method Overview

Methods

PredicatedScalarEvolution(
    llvm::ScalarEvolution& SE,
    llvm::Loop& L)

Declared at: llvm/include/llvm/Analysis/ScalarEvolution.h:1976

Parameters

llvm::ScalarEvolution& SE
llvm::Loop& L

PredicatedScalarEvolution(
    const llvm::PredicatedScalarEvolution&)

Description

We need to explicitly define the copy constructor because of FlagsMap.

Declared at: llvm/include/llvm/Analysis/ScalarEvolution.h:2009

Parameters

const llvm::PredicatedScalarEvolution&

void addPredicate(const llvm::SCEVPredicate& Pred)

Description

Adds a new predicate.

Declared at: llvm/include/llvm/Analysis/ScalarEvolution.h:1990

Parameters

const llvm::SCEVPredicate& Pred

bool areAddRecsEqualWithPreds(
    const llvm::SCEVAddRecExpr* AR1,
    const llvm::SCEVAddRecExpr* AR2) const

Description

Check if \p AR1 and \p AR2 are equal, while taking into account Equal predicates in Preds.

Declared at: llvm/include/llvm/Analysis/ScalarEvolution.h:2017

Parameters

const llvm::SCEVAddRecExpr* AR1
const llvm::SCEVAddRecExpr* AR2

const llvm::SCEVAddRecExpr* getAsAddRec(
    llvm::Value* V)

Description

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.

Declared at: llvm/include/llvm/Analysis/ScalarEvolution.h:1996

Parameters

llvm::Value* V

const llvm::SCEV* getBackedgeTakenCount()

Description

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

Declared at: llvm/include/llvm/Analysis/ScalarEvolution.h:1987

const llvm::SCEV* getSCEV(llvm::Value* V)

Description

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.

Declared at: llvm/include/llvm/Analysis/ScalarEvolution.h:1984

Parameters

llvm::Value* V

llvm::ScalarEvolution* getSE() const

Description

Returns the ScalarEvolution analysis used.

Declared at: llvm/include/llvm/Analysis/ScalarEvolution.h:2006

const llvm::SCEVUnionPredicate&
getUnionPredicate() const

Declared at: llvm/include/llvm/Analysis/ScalarEvolution.h:1978

bool hasNoOverflow(
    llvm::Value* V,
    SCEVWrapPredicate::IncrementWrapFlags Flags)

Description

Returns true if we've proved that V doesn't wrap by means of a SCEV predicate.

Declared at: llvm/include/llvm/Analysis/ScalarEvolution.h:2003

Parameters

llvm::Value* V
SCEVWrapPredicate::IncrementWrapFlags Flags

void print(llvm::raw_ostream& OS,
           unsigned int Depth) const

Description

Print the SCEV mappings done by the Predicated Scalar Evolution. The printed text is indented by \p Depth.

Declared at: llvm/include/llvm/Analysis/ScalarEvolution.h:2013

Parameters

llvm::raw_ostream& OS
unsigned int Depth

void setNoOverflow(
    llvm::Value* V,
    SCEVWrapPredicate::IncrementWrapFlags Flags)

Description

Proves that V doesn't overflow by adding SCEV predicate.

Declared at: llvm/include/llvm/Analysis/ScalarEvolution.h:1999

Parameters

llvm::Value* V
SCEVWrapPredicate::IncrementWrapFlags Flags