From: Sebastian Pop Date: Fri, 15 Feb 2013 21:26:44 +0000 (+0000) Subject: add NestLoops to remove some uses of IVS X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=860e021fe68a2ac151cdc3e9f70fa0c96342ab44;p=platform%2Fupstream%2Fllvm.git add NestLoops to remove some uses of IVS llvm-svn: 175303 --- diff --git a/polly/include/polly/ScopInfo.h b/polly/include/polly/ScopInfo.h index 15c3261..7b2ab13 100755 --- a/polly/include/polly/ScopInfo.h +++ b/polly/include/polly/ScopInfo.h @@ -277,6 +277,7 @@ class ScopStmt { /// /// This information is only needed for final code generation. std::vector > IVS; + std::vector NestLoops; std::string BaseName; diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index e361b6a..19ef3b3 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -586,14 +586,15 @@ ScopStmt::buildDomain(TempScop &tempScop, const Region &CurRegion) { } ScopStmt::ScopStmt(Scop &parent, TempScop &tempScop, const Region &CurRegion, - BasicBlock &bb, SmallVectorImpl &NestLoops, + BasicBlock &bb, SmallVectorImpl &Nest, SmallVectorImpl &Scatter) - : Parent(parent), BB(&bb), IVS(NestLoops.size()) { + : Parent(parent), BB(&bb), IVS(Nest.size()), NestLoops(Nest.size()) { // Setup the induction variables. - for (unsigned i = 0, e = NestLoops.size(); i < e; ++i) { - PHINode *PN = NestLoops[i]->getCanonicalInductionVariable(); + for (unsigned i = 0, e = Nest.size(); i < e; ++i) { + PHINode *PN = Nest[i]->getCanonicalInductionVariable(); assert(PN && "Non canonical IV in Scop!"); - IVS[i] = std::make_pair(PN, NestLoops[i]); + IVS[i] = std::make_pair(PN, Nest[i]); + NestLoops[i] = Nest[i]; } raw_string_ostream OS(BaseName); @@ -621,7 +622,7 @@ unsigned ScopStmt::getNumIterators() const { if (!BB) return 1; - return IVS.size(); + return NestLoops.size(); } unsigned ScopStmt::getNumScattering() const { @@ -636,7 +637,7 @@ ScopStmt::getInductionVariableForDimension(unsigned Dimension) const { } const Loop *ScopStmt::getLoopForDimension(unsigned Dimension) const { - return IVS[Dimension].second; + return NestLoops[Dimension]; } isl_ctx *ScopStmt::getIslCtx() const { return Parent.getIslCtx(); }