This visitor recursively visits a SCEV expression and re‐writes it. The result from each visit is cached, so it will return the same SCEV for the same input.

Synopsis

Declared in <llvm/Analysis/ScalarEvolutionExpressions.h>

template<typename SC>
class SCEVRewriteVisitor
    : public SCEVVisitor<SC, SCEV const*>

Base Classes

Name

Description

SCEVVisitor<SC, SCEV const*>

This class defines a simple visitor class that may be used for various SCEV analysis purposes.

Member Functions

Name

Description

SCEVRewriteVisitor [constructor]

Construct a rewrite visitor using scalar evolution SE.

visit

Rewrite S, memoizing the result for repeated visits.

visitAddExpr

Rewrite an add by rewriting each operand.

visitAddRecExpr

Rewrite an add‐recurrence by rewriting each operand.

visitConstant

Return Constant unchanged.

visitCouldNotCompute

visitCouldNotCompute overloads

visitMulExpr

Rewrite a mul by rewriting each operand.

visitPtrToAddrExpr

Rewrite a pointer‐to‐address cast by rewriting its operand.

visitSMaxExpr

Rewrite a signed max by rewriting each operand.

visitSMinExpr

Rewrite a signed min by rewriting each operand.

visitSequentialUMinExpr

Rewrite a sequential unsigned min by rewriting each operand.

visitSignExtendExpr

Rewrite a sign‐extend by rewriting its operand.

visitTruncateExpr

Rewrite a truncate by rewriting its operand.

visitUDivExpr

Rewrite an unsigned division by rewriting both operands.

visitUMaxExpr

Rewrite an unsigned max by rewriting each operand.

visitUMinExpr

Rewrite an unsigned min by rewriting each operand.

visitUnknown

Return Expr unchanged.

visitVScale

Return VScale unchanged.

visitZeroExtendExpr

Rewrite a zero‐extend by rewriting its operand.

Protected Data Members

Name

Description

RewriteResults

Memoized rewrite results keyed by the original SCEV.

SE

Scalar evolution used to rebuild rewritten expressions.

Derived Classes

Name

Description

SCEVLoopAddRecRewriter

The SCEVLoopAddRecRewriter takes a scalar evolution expression and applies the Map (Loop ‐> SCEV) to all AddRecExprs.

SCEVParameterRewriter

The SCEVParameterRewriter takes a scalar evolution expression and updates the SCEVUnknown components following the Map (Value ‐> SCEV).

Created with MrDocs