Changeset View
Changeset View
Standalone View
Standalone View
lib/Analysis/ScopInfo.cpp
Show First 20 Lines • Show All 3,419 Lines • ▼ Show 20 Lines | while (L) { | ||||
L = L->getParentLoop(); | L = L->getParentLoop(); | ||||
} | } | ||||
return L ? (S.contains(L) ? L->getParentLoop() : L) : nullptr; | return L ? (S.contains(L) ? L->getParentLoop() : L) : nullptr; | ||||
} | } | ||||
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(getCurrentNameStr()), IsOptimized(false), | ||||
HasSingleExitEdge(R.getExitingBlock()), HasErrorBlock(false), | HasSingleExitEdge(R.getExitingBlock()), HasErrorBlock(false), | ||||
MaxLoopDepth(0), CopyStmtsNum(0), DC(DC), | MaxLoopDepth(0), CopyStmtsNum(0), 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) { | ||||
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(); | ||||
▲ Show 20 Lines • Show All 682 Lines • ▼ Show 20 Lines | std::string Scop::getAssumedContextStr() const { | ||||
assert(AssumedContext && "Assumed context not yet built"); | assert(AssumedContext && "Assumed context not yet built"); | ||||
return stringFromIslObj(AssumedContext); | return stringFromIslObj(AssumedContext); | ||||
} | } | ||||
std::string Scop::getInvalidContextStr() const { | std::string Scop::getInvalidContextStr() const { | ||||
return stringFromIslObj(InvalidContext); | return stringFromIslObj(InvalidContext); | ||||
} | } | ||||
std::string Scop::getNameStr() const { | std::string Scop::getCurrentNameStr() const { | ||||
std::string ExitName, EntryName; | std::string ExitName, EntryName; | ||||
std::tie(EntryName, ExitName) = getEntryExitStr(); | std::tie(EntryName, ExitName) = getEntryExitStr(); | ||||
return EntryName + "---" + ExitName; | return EntryName + "---" + ExitName; | ||||
} | } | ||||
std::pair<std::string, std::string> Scop::getEntryExitStr() const { | std::pair<std::string, std::string> Scop::getEntryExitStr() const { | ||||
std::string ExitName, EntryName; | std::string ExitName, EntryName; | ||||
raw_string_ostream ExitStr(ExitName); | raw_string_ostream ExitStr(ExitName); | ||||
▲ Show 20 Lines • Show All 926 Lines • Show Last 20 Lines |