LLVM 22.0.0git
SCEVCastSinkingRewriter Class Reference

The SCEVCastSinkingRewriter takes a scalar evolution expression, which computes a pointer-typed value, and rewrites the whole expression tree so that all the computations are done on integers, and the only pointer-typed operands in the expression are SCEVUnknown. More...

Inheritance diagram for SCEVCastSinkingRewriter:
[legend]

Public Member Functions

 SCEVCastSinkingRewriter (ScalarEvolution &SE, Type *TargetTy, ConversionFn CreatePtrCast)
const SCEVvisit (const SCEV *S)
const SCEVvisitAddExpr (const SCEVAddExpr *Expr)
const SCEVvisitMulExpr (const SCEVMulExpr *Expr)
const SCEVvisitUnknown (const SCEVUnknown *Expr)
Public Member Functions inherited from llvm::SCEVRewriteVisitor< SCEVCastSinkingRewriter >
 SCEVRewriteVisitor (ScalarEvolution &SE)
const SCEVvisit (const SCEV *S)
const SCEVvisitConstant (const SCEVConstant *Constant)
const SCEVvisitVScale (const SCEVVScale *VScale)
const SCEVvisitPtrToIntExpr (const SCEVPtrToIntExpr *Expr)
const SCEVvisitTruncateExpr (const SCEVTruncateExpr *Expr)
const SCEVvisitZeroExtendExpr (const SCEVZeroExtendExpr *Expr)
const SCEVvisitSignExtendExpr (const SCEVSignExtendExpr *Expr)
const SCEVvisitAddExpr (const SCEVAddExpr *Expr)
const SCEVvisitMulExpr (const SCEVMulExpr *Expr)
const SCEVvisitUDivExpr (const SCEVUDivExpr *Expr)
const SCEVvisitAddRecExpr (const SCEVAddRecExpr *Expr)
const SCEVvisitSMaxExpr (const SCEVSMaxExpr *Expr)
const SCEVvisitUMaxExpr (const SCEVUMaxExpr *Expr)
const SCEVvisitSMinExpr (const SCEVSMinExpr *Expr)
const SCEVvisitUMinExpr (const SCEVUMinExpr *Expr)
const SCEVvisitSequentialUMinExpr (const SCEVSequentialUMinExpr *Expr)
const SCEVvisitUnknown (const SCEVUnknown *Expr)
const SCEVvisitCouldNotCompute (const SCEVCouldNotCompute *Expr)
Public Member Functions inherited from llvm::SCEVVisitor< SC, RetVal >
RetVal visit (const SCEV *S)
RetVal visitCouldNotCompute (const SCEVCouldNotCompute *S)

Static Public Member Functions

static const SCEVrewrite (const SCEV *Scev, ScalarEvolution &SE, Type *TargetTy, ConversionFn CreatePtrCast)

Additional Inherited Members

Protected Attributes inherited from llvm::SCEVRewriteVisitor< SCEVCastSinkingRewriter >
ScalarEvolutionSE
SmallDenseMap< const SCEV *, const SCEV * > RewriteResults

Detailed Description

The SCEVCastSinkingRewriter takes a scalar evolution expression, which computes a pointer-typed value, and rewrites the whole expression tree so that all the computations are done on integers, and the only pointer-typed operands in the expression are SCEVUnknown.

The CreatePtrCast callback is invoked to create the actual conversion (ptrtoint or ptrtoaddr) at the SCEVUnknown leaves.

Definition at line 1016 of file ScalarEvolution.cpp.

Constructor & Destructor Documentation

◆ SCEVCastSinkingRewriter()

SCEVCastSinkingRewriter::SCEVCastSinkingRewriter ( ScalarEvolution & SE,
Type * TargetTy,
ConversionFn CreatePtrCast )
inline

Definition at line 1024 of file ScalarEvolution.cpp.

References llvm::move(), and llvm::SCEVRewriteVisitor< SCEVCastSinkingRewriter >::SE.

Referenced by rewrite().

Member Function Documentation

◆ rewrite()

const SCEV * SCEVCastSinkingRewriter::rewrite ( const SCEV * Scev,
ScalarEvolution & SE,
Type * TargetTy,
ConversionFn CreatePtrCast )
inlinestatic

◆ visit()

const SCEV * SCEVCastSinkingRewriter::visit ( const SCEV * S)
inline

◆ visitAddExpr()

◆ visitMulExpr()

◆ visitUnknown()


The documentation for this class was generated from the following file: