Polly 20.0.0git
|
ScopExpander generates IR the the value of a SCEV that represents a value from a SCoP. More...
Public Member Functions | |
ScopExpander (const Region &R, ScalarEvolution &SE, Function *GenFn, ScalarEvolution &GenSE, const DataLayout &DL, const char *Name, ValueMapT *VMap, LoopToScevMapT *LoopMap, BasicBlock *RTCBB) | |
Value * | expandCodeFor (const SCEV *E, Type *Ty, Instruction *IP) |
const SCEV * | visit (const SCEV *E) |
Private Member Functions | |
bool | isInOrigRegion (Instruction *Inst) |
Is the instruction part of the original SCoP (in contrast to be located in the code-generated region)? | |
bool | isInGenRegion (Instruction *Inst) |
const SCEV * | visitGenericInst (const SCEVUnknown *E, Instruction *Inst, Instruction *IP) |
const SCEV * | visitUnknown (const SCEVUnknown *E) |
const SCEV * | visitConstant (const SCEVConstant *E) |
The following functions will just traverse the SCEV and rebuild it using GenSE and the new operands returned by the traversal. | |
const SCEV * | visitVScale (const SCEVVScale *E) |
const SCEV * | visitPtrToIntExpr (const SCEVPtrToIntExpr *E) |
const SCEV * | visitTruncateExpr (const SCEVTruncateExpr *E) |
const SCEV * | visitZeroExtendExpr (const SCEVZeroExtendExpr *E) |
const SCEV * | visitSignExtendExpr (const SCEVSignExtendExpr *E) |
const SCEV * | visitUDivExpr (const SCEVUDivExpr *E) |
const SCEV * | visitAddExpr (const SCEVAddExpr *E) |
const SCEV * | visitMulExpr (const SCEVMulExpr *E) |
const SCEV * | visitUMaxExpr (const SCEVUMaxExpr *E) |
const SCEV * | visitSMaxExpr (const SCEVSMaxExpr *E) |
const SCEV * | visitUMinExpr (const SCEVUMinExpr *E) |
const SCEV * | visitSMinExpr (const SCEVSMinExpr *E) |
const SCEV * | visitSequentialUMinExpr (const SCEVSequentialUMinExpr *E) |
const SCEV * | visitAddRecExpr (const SCEVAddRecExpr *E) |
Private Attributes | |
SCEVExpander | Expander |
const char * | Name |
const Region & | R |
ValueMapT * | VMap |
LoopToScevMapT * | LoopMap |
BasicBlock * | RTCBB |
DenseMap< const SCEV *, const SCEV * > | SCEVCache |
ScalarEvolution & | GenSE |
Function * | GenFn |
Friends | |
struct | SCEVVisitor< ScopExpander, const SCEV * > |
ScopExpander generates IR the the value of a SCEV that represents a value from a SCoP.
IMPORTANT: There are two ScalarEvolutions at play here. First, the SE that was used to analyze the original SCoP (not actually referenced anywhere here, but passed as argument to make the distinction clear). Second, GenSE which is the SE for the function that the code is emitted into. SE and GenSE may be different when the generated code is to be emitted into an outlined function, e.g. for a parallel loop. That is, each SCEV is to be used only by the SE that "owns" it and ScopExpander handles the translation between them. The SCEVVisitor methods are only to be called on SCEVs of the original SE. Their job is to create a new SCEV for GenSE. The nested SCEVExpander is to be used only with SCEVs belonging to GenSE. Currently SCEVs do not store a reference to the ScalarEvolution they belong to, so a mixup does not immediately cause a crash but certainly is a violation of its interface.
The SCEVExpander will not generate any code for an existing SDiv/SRem instruction but just use it, if it is referenced as a SCEVUnknown. We want however to generate new code if the instruction is in the analyzed region and we generate code outside/in front of that region. Hence, we generate the code for the SDiv/SRem operands in front of the analyzed region and then create a new SDiv/SRem operation there too.
Definition at line 253 of file ScopHelper.cpp.
|
inlineexplicit |
Definition at line 256 of file ScopHelper.cpp.
|
inline |
Definition at line 264 of file ScopHelper.cpp.
References assert, Expander, isInGenRegion(), polly::Value, and visit().
Referenced by visitGenericInst(), and visitUnknown().
|
inlineprivate |
Definition at line 305 of file ScopHelper.cpp.
References isInOrigRegion().
Referenced by expandCodeFor(), visitGenericInst(), and visitUnknown().
|
inlineprivate |
Is the instruction part of the original SCoP (in contrast to be located in the code-generated region)?
Definition at line 296 of file ScopHelper.cpp.
References assert, Function, GenFn, isInOrigRegion(), and R.
Referenced by isInGenRegion(), and isInOrigRegion().
|
inline |
Definition at line 271 of file ScopHelper.cpp.
References SCEVCache.
Referenced by expandCodeFor(), visitAddExpr(), visitAddRecExpr(), visitMulExpr(), visitPtrToIntExpr(), visitSequentialUMinExpr(), visitSignExtendExpr(), visitSMaxExpr(), visitSMinExpr(), visitTruncateExpr(), visitUDivExpr(), visitUMaxExpr(), visitUMinExpr(), visitUnknown(), and visitZeroExtendExpr().
|
inlineprivate |
Definition at line 401 of file ScopHelper.cpp.
|
inlineprivate |
Definition at line 443 of file ScopHelper.cpp.
|
inlineprivate |
The following functions will just traverse the SCEV and rebuild it using GenSE and the new operands returned by the traversal.
{
Definition at line 381 of file ScopHelper.cpp.
|
inlineprivate |
Definition at line 307 of file ScopHelper.cpp.
References assert, expandCodeFor(), GenSE, isInGenRegion(), and Name.
Referenced by visitUnknown().
|
inlineprivate |
Definition at line 407 of file ScopHelper.cpp.
|
inlineprivate |
Definition at line 383 of file ScopHelper.cpp.
|
inlineprivate |
Definition at line 437 of file ScopHelper.cpp.
|
inlineprivate |
Definition at line 392 of file ScopHelper.cpp.
|
inlineprivate |
Definition at line 419 of file ScopHelper.cpp.
|
inlineprivate |
Definition at line 431 of file ScopHelper.cpp.
|
inlineprivate |
Definition at line 386 of file ScopHelper.cpp.
|
inlineprivate |
Definition at line 395 of file ScopHelper.cpp.
|
inlineprivate |
Definition at line 413 of file ScopHelper.cpp.
|
inlineprivate |
Definition at line 425 of file ScopHelper.cpp.
|
inlineprivate |
Definition at line 328 of file ScopHelper.cpp.
References expandCodeFor(), GenFn, GenSE, isInGenRegion(), Name, R, RTCBB, polly::Value, visit(), visitGenericInst(), and VMap.
|
inlineprivate |
Definition at line 382 of file ScopHelper.cpp.
|
inlineprivate |
Definition at line 389 of file ScopHelper.cpp.
|
friend |
Definition at line 871 of file ScopHelper.cpp.
|
private |
Definition at line 283 of file ScopHelper.cpp.
Referenced by expandCodeFor().
|
private |
Definition at line 292 of file ScopHelper.cpp.
Referenced by isInOrigRegion(), and visitUnknown().
|
private |
Definition at line 291 of file ScopHelper.cpp.
Referenced by visitAddExpr(), visitAddRecExpr(), visitGenericInst(), visitMulExpr(), visitPtrToIntExpr(), visitSequentialUMinExpr(), visitSignExtendExpr(), visitSMaxExpr(), visitSMinExpr(), visitTruncateExpr(), visitUDivExpr(), visitUMaxExpr(), visitUMinExpr(), visitUnknown(), and visitZeroExtendExpr().
|
private |
Definition at line 287 of file ScopHelper.cpp.
Referenced by visitAddRecExpr().
|
private |
Definition at line 284 of file ScopHelper.cpp.
Referenced by visitGenericInst(), and visitUnknown().
|
private |
Definition at line 285 of file ScopHelper.cpp.
Referenced by isInOrigRegion(), and visitUnknown().
|
private |
Definition at line 288 of file ScopHelper.cpp.
Referenced by visitUnknown().
|
private |
Definition at line 289 of file ScopHelper.cpp.
Referenced by visit().
|
private |
Definition at line 286 of file ScopHelper.cpp.
Referenced by visitUnknown().