diff options
Diffstat (limited to 'polly/lib')
-rw-r--r-- | polly/lib/Analysis/ScopInfo.cpp | 15 | ||||
-rw-r--r-- | polly/lib/CodeGen/PPCGCodeGeneration.cpp | 4 |
2 files changed, 16 insertions, 3 deletions
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index bf6972347b7..49a49f1fe1a 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -3499,6 +3499,18 @@ static Loop *getLoopSurroundingScop(Scop &S, LoopInfo &LI) { 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, ScopDetection::DetectionContext &DC) : SE(&ScalarEvolution), R(R), name(R.getNameStr()), IsOptimized(false), @@ -3506,7 +3518,8 @@ Scop::Scop(Region &R, ScalarEvolution &ScalarEvolution, LoopInfo &LI, MaxLoopDepth(0), CopyStmtsNum(0), SkipScop(false), DC(DC), IslCtx(isl_ctx_alloc(), isl_ctx_free), Context(nullptr), Affinator(this, LI), AssumedContext(nullptr), InvalidContext(nullptr), - Schedule(nullptr) { + Schedule(nullptr), + ID(getNextID((*R.getEntry()->getParent()).getName().str())) { if (IslOnErrorAbort) isl_options_set_on_error(getIslCtx(), ISL_ON_ERROR_ABORT); buildContext(); diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp index d2e4b2b72e7..93a8417d886 100644 --- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp +++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp @@ -686,8 +686,8 @@ private: }; std::string GPUNodeBuilder::getKernelFuncName(int Kernel_id) { - return "FUNC_" + S.getFunction().getName().str() + "_KERNEL_" + - std::to_string(Kernel_id); + return "FUNC_" + S.getFunction().getName().str() + "_SCOP_" + + std::to_string(S.getID()) + "_KERNEL_" + std::to_string(Kernel_id); } void GPUNodeBuilder::initializeAfterRTH() { |