LLVM 24.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 SCEV * visit (const SCEV *S)
const SCEV * visitAddExpr (const SCEVAddExpr *Expr)
const SCEV * visitUnknown (const SCEVUnknown *Expr)
Public Member Functions inherited from llvm::SCEVRewriteVisitor< SCEVCastSinkingRewriter >
 SCEVRewriteVisitor (ScalarEvolution &SE)
const SCEV * visit (const SCEV *S)
const SCEV * visitConstant (const SCEVConstant *Constant)
const SCEV * visitVScale (const SCEVVScale *VScale)
const SCEV * visitPtrToAddrExpr (const SCEVPtrToAddrExpr *Expr)
const SCEV * visitTruncateExpr (const SCEVTruncateExpr *Expr)
const SCEV * visitZeroExtendExpr (const SCEVZeroExtendExpr *Expr)
const SCEV * visitSignExtendExpr (const SCEVSignExtendExpr *Expr)
const SCEV * visitAddExpr (const SCEVAddExpr *Expr)
const SCEV * visitMulExpr (const SCEVMulExpr *Expr)
const SCEV * visitUDivExpr (const SCEVUDivExpr *Expr)
const SCEV * visitAddRecExpr (const SCEVAddRecExpr *Expr)
const SCEV * visitSMaxExpr (const SCEVSMaxExpr *Expr)
const SCEV * visitUMaxExpr (const SCEVUMaxExpr *Expr)
const SCEV * visitSMinExpr (const SCEVSMinExpr *Expr)
const SCEV * visitUMinExpr (const SCEVUMinExpr *Expr)
const SCEV * visitSequentialUMinExpr (const SCEVSequentialUMinExpr *Expr)
const SCEV * visitUnknown (const SCEVUnknown *Expr)
const SCEV * visitCouldNotCompute (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 SCEV * rewrite (const SCEV *Scev, ScalarEvolution &SE, Type *TargetTy, ConversionFn CreatePtrCast)

Additional Inherited Members

Protected Attributes inherited from llvm::SCEVRewriteVisitor< SCEVCastSinkingRewriter >
ScalarEvolution & SE
SmallDenseMap< const SCEV *, const SCEV *, 16 > 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 1029 of file ScalarEvolution.cpp.

Constructor & Destructor Documentation

◆ SCEVCastSinkingRewriter()

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

Definition at line 1037 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()

◆ visitUnknown()


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