[PATCH] D11873: [RegionInfo] Remove unused and broken function splitBlock

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 8 12:07:10 PDT 2015


Meinersbur created this revision.
Meinersbur added a reviewer: grosser.
Meinersbur added a subscriber: llvm-commits.
Meinersbur set the repository for this revision to rL LLVM.

It always makes NewBB the entry of the region instead of OldBB. This breaks if there are edges from inside the region to OldBB. OldBB is moved out of the region and hence there are exiting edges to OldBB and the region's exit block, contradicting the single-exit condition for regions.

The only use from Polly is going to be removed, hence I propose to remove the function completely.

Repository:
  rL LLVM

http://reviews.llvm.org/D11873

Files:
  include/llvm/Analysis/RegionInfo.h
  include/llvm/Analysis/RegionInfoImpl.h

Index: include/llvm/Analysis/RegionInfoImpl.h
===================================================================
--- include/llvm/Analysis/RegionInfoImpl.h
+++ include/llvm/Analysis/RegionInfoImpl.h
@@ -911,20 +911,6 @@
 }
 
 template <class Tr>
-void RegionInfoBase<Tr>::splitBlock(BlockT *NewBB, BlockT *OldBB) {
-  RegionT *R = getRegionFor(OldBB);
-
-  setRegionFor(NewBB, R);
-
-  while (R->getEntry() == OldBB && !R->isTopLevelRegion()) {
-    R->replaceEntry(NewBB);
-    R = R->getParent();
-  }
-
-  setRegionFor(OldBB, R);
-}
-
-template <class Tr>
 void RegionInfoBase<Tr>::calculate(FuncT &F) {
   typedef typename std::add_pointer<FuncT>::type FuncPtrT;
 
Index: include/llvm/Analysis/RegionInfo.h
===================================================================
--- include/llvm/Analysis/RegionInfo.h
+++ include/llvm/Analysis/RegionInfo.h
@@ -801,12 +801,6 @@
 
   RegionT *getTopLevelRegion() const { return TopLevelRegion; }
 
-  /// @brief Update RegionInfo after a basic block was split.
-  ///
-  /// @param NewBB The basic block that was created before OldBB.
-  /// @param OldBB The old basic block.
-  void splitBlock(BlockT *NewBB, BlockT *OldBB);
-
   /// @brief Clear the Node Cache for all Regions.
   ///
   /// @see Region::clearNodeCache()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11873.31592.patch
Type: text/x-patch
Size: 1274 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150808/667451c5/attachment.bin>


More information about the llvm-commits mailing list