[polly] r244404 - [Polly] Remove dead code in IndependentBlocks

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 8 13:31:20 PDT 2015


Author: meinersbur
Date: Sat Aug  8 15:31:20 2015
New Revision: 244404

URL: http://llvm.org/viewvc/llvm-project?rev=244404&view=rev
Log:
[Polly] Remove dead code in IndependentBlocks

Summary: The splitExitBlock function is never called. Going to replace its functionality in successive patches that do not modify the IR.

Reviewers: grosser

Subscribers: pollydev

Projects: #polly

Differential Revision: http://reviews.llvm.org/D11865

Modified:
    polly/trunk/lib/Transform/IndependentBlocks.cpp

Modified: polly/trunk/lib/Transform/IndependentBlocks.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Transform/IndependentBlocks.cpp?rev=244404&r1=244403&r2=244404&view=diff
==============================================================================
--- polly/trunk/lib/Transform/IndependentBlocks.cpp (original)
+++ polly/trunk/lib/Transform/IndependentBlocks.cpp Sat Aug  8 15:31:20 2015
@@ -128,7 +128,6 @@ struct IndependentBlocks : public Functi
   bool areAllBlocksIndependent(const Region *R) const;
 
   // Split the exit block to hold load instructions.
-  bool splitExitBlock(Region *R);
   bool onlyUsedInRegion(Instruction *Inst, const Region *R);
   bool translateScalarToArray(BasicBlock *BB, const Region *R);
   bool translateScalarToArray(Instruction *Inst, const Region *R);
@@ -318,34 +317,6 @@ bool IndependentBlocks::isEscapeOperand(
   return R->contains(OpInst) && (OpInst->getParent() != CurBB);
 }
 
-bool IndependentBlocks::splitExitBlock(Region *R) {
-  // Split the exit BB to place the load instruction of escaped users.
-  BasicBlock *ExitBB = R->getExit();
-  Region *ExitRegion = RI->getRegionFor(ExitBB);
-
-  if (ExitBB != ExitRegion->getEntry())
-    return false;
-
-  BasicBlock *NewExit = createSingleExitEdge(R, this);
-
-  std::vector<Region *> toUpdate;
-  toUpdate.push_back(R);
-
-  while (!toUpdate.empty()) {
-    Region *R = toUpdate.back();
-    toUpdate.pop_back();
-
-    for (auto &&SubRegion : *R)
-      if (SubRegion->getExit() == ExitBB)
-        toUpdate.push_back(SubRegion.get());
-
-    R->replaceExit(NewExit);
-  }
-
-  RI->setRegionFor(NewExit, R->getParent());
-  return true;
-}
-
 bool IndependentBlocks::translateScalarToArray(const Region *R) {
   bool Changed = false;
 




More information about the llvm-commits mailing list