Enzyme main
Loading...
Searching...
No Matches
NonAffineClosedFormRewriter Struct Reference

Replace every non-affine recurrence (of degree at most three) inside an expression by its closed form in the canonical induction variable of its loop, treated as an opaque value. More...

Inheritance diagram for NonAffineClosedFormRewriter:
Collaboration diagram for NonAffineClosedFormRewriter:

Public Member Functions

 NonAffineClosedFormRewriter (ScalarEvolution &SE)
 
const SCEV * visitAddRecExpr (const SCEVAddRecExpr *AR)
 

Detailed Description

Replace every non-affine recurrence (of degree at most three) inside an expression by its closed form in the canonical induction variable of its loop, treated as an opaque value.

SCEVExpander expands a recurrence with more than two operands literally, as nested loop-carried phis (it would otherwise need a canonical IV one bit wider than the value). Such a phi is as impossible to recompute in the reverse pass as the accumulator it came from, so e.g. the start value i*(2*d-i-1)/2 of an inner index, expanded while rewriting the inner phi, would leave acc += 2*d-1-2*i in the outer loop and get cached once per iteration. evaluateAtIterationWithoutExt needs no wider type, so it can take the case the expander declines.

Definition at line 228 of file CacheUtility.cpp.

Constructor & Destructor Documentation

◆ NonAffineClosedFormRewriter()

NonAffineClosedFormRewriter::NonAffineClosedFormRewriter ( ScalarEvolution & SE)
inline

Definition at line 230 of file CacheUtility.cpp.

Member Function Documentation

◆ visitAddRecExpr()

const SCEV * NonAffineClosedFormRewriter::visitAddRecExpr ( const SCEVAddRecExpr * AR)
inline

Definition at line 232 of file CacheUtility.cpp.

References evaluateAtIterationWithoutExt().


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