Changeset View
Changeset View
Standalone View
Standalone View
lib/Analysis/ScopInfo.cpp
Show First 20 Lines • Show All 3,488 Lines • ▼ Show 20 Lines | while (L) { | ||||
if (AllContained) | if (AllContained) | ||||
break; | break; | ||||
L = L->getParentLoop(); | L = L->getParentLoop(); | ||||
} | } | ||||
return L ? (S.contains(L) ? L->getParentLoop() : L) : nullptr; | return L ? (S.contains(L) ? L->getParentLoop() : L) : nullptr; | ||||
} | } | ||||
int Scop::NextScopID = 0; | |||||
std::string Scop::CurrentFunc = ""; | |||||
int Scop::getNextID(std::string ParentFunc) { | |||||
if (ParentFunc != CurrentFunc) { | |||||
CurrentFunc = ParentFunc; | |||||
NextScopID = 0; | |||||
} | |||||
return NextScopID++; | |||||
} | |||||
Scop::Scop(Region &R, ScalarEvolution &ScalarEvolution, LoopInfo &LI, | Scop::Scop(Region &R, ScalarEvolution &ScalarEvolution, LoopInfo &LI, | ||||
ScopDetection::DetectionContext &DC) | ScopDetection::DetectionContext &DC) | ||||
: SE(&ScalarEvolution), R(R), name(R.getNameStr()), IsOptimized(false), | : SE(&ScalarEvolution), R(R), name(R.getNameStr()), IsOptimized(false), | ||||
HasSingleExitEdge(R.getExitingBlock()), HasErrorBlock(false), | HasSingleExitEdge(R.getExitingBlock()), HasErrorBlock(false), | ||||
MaxLoopDepth(0), CopyStmtsNum(0), SkipScop(false), DC(DC), | MaxLoopDepth(0), CopyStmtsNum(0), SkipScop(false), DC(DC), | ||||
IslCtx(isl_ctx_alloc(), isl_ctx_free), Context(nullptr), | IslCtx(isl_ctx_alloc(), isl_ctx_free), Context(nullptr), | ||||
Affinator(this, LI), AssumedContext(nullptr), InvalidContext(nullptr), | Affinator(this, LI), AssumedContext(nullptr), InvalidContext(nullptr), | ||||
Schedule(nullptr) { | Schedule(nullptr), | ||||
ID(getNextID((*R.getEntry()->getParent()).getName().str())) { | |||||
if (IslOnErrorAbort) | if (IslOnErrorAbort) | ||||
isl_options_set_on_error(getIslCtx(), ISL_ON_ERROR_ABORT); | isl_options_set_on_error(getIslCtx(), ISL_ON_ERROR_ABORT); | ||||
buildContext(); | buildContext(); | ||||
} | } | ||||
void Scop::foldSizeConstantsToRight() { | void Scop::foldSizeConstantsToRight() { | ||||
isl_union_set *Accessed = isl_union_map_range(getAccesses()); | isl_union_set *Accessed = isl_union_map_range(getAccesses()); | ||||
▲ Show 20 Lines • Show All 1,610 Lines • Show Last 20 Lines |