[polly] r324168 - [ScopInfo] Allow epilogues to be the main statement of a BB.

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 2 21:43:00 PST 2018


Author: meinersbur
Date: Fri Feb  2 21:43:00 2018
New Revision: 324168

URL: http://llvm.org/viewvc/llvm-project?rev=324168&view=rev
Log:
[ScopInfo] Allow epilogues to be the main statement of a BB.

Do not add a "_last" suffix to the statement name if there is no (other)
main statement for a basic block. In other words, it becomes the main
statement itself. This further reduces the statement naming difference
between -polly-stmt-granularity=bb and
-polly-stmt-granularity=scalar-indep.

Modified:
    polly/trunk/lib/Analysis/ScopBuilder.cpp

Modified: polly/trunk/lib/Analysis/ScopBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopBuilder.cpp?rev=324168&r1=324167&r2=324168&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopBuilder.cpp (original)
+++ polly/trunk/lib/Analysis/ScopBuilder.cpp Fri Feb  2 21:43:00 2018
@@ -856,6 +856,7 @@ void ScopBuilder::buildEqivClassBlockStm
   // Finally build the statements.
   int Count = 0;
   long BBIdx = scop->getNextStmtIdx();
+  bool MainFound = false;
   for (auto &Instructions : reverse(LeaderToInstList)) {
     std::vector<Instruction *> &InstList = Instructions.second;
 
@@ -866,6 +867,8 @@ void ScopBuilder::buildEqivClassBlockStm
                InstList.end();
     else
       IsMain = (Count == 0);
+    if (IsMain)
+      MainFound = true;
 
     std::reverse(InstList.begin(), InstList.end());
     std::string Name = makeStmtName(BB, BBIdx, Count, IsMain);
@@ -877,7 +880,7 @@ void ScopBuilder::buildEqivClassBlockStm
   // instructions, but holds the PHI write accesses for successor basic blocks,
   // if the incoming value is not defined in another statement if the same BB.
   // The epilogue will be removed if no PHIWrite is added to it.
-  std::string EpilogueName = makeStmtName(BB, BBIdx, Count, false, true);
+  std::string EpilogueName = makeStmtName(BB, BBIdx, Count, !MainFound, true);
   scop->addScopStmt(BB, EpilogueName, L, {});
 }
 




More information about the llvm-commits mailing list