[PATCH] D15922: [Cloning] cloneLoopWithPreheader(): add assert to ensure no sub-loops

Vaivaswatha Nagaraj via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 26 22:31:03 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL267671: [Cloning] cloneLoopWithPreheader(): add assert to ensure no sub-loops (authored by vaivaswatha).

Changed prior to commit:
  http://reviews.llvm.org/D15922?vs=55162&id=55163#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15922

Files:
  llvm/trunk/include/llvm/Transforms/Utils/Cloning.h
  llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp

Index: llvm/trunk/include/llvm/Transforms/Utils/Cloning.h
===================================================================
--- llvm/trunk/include/llvm/Transforms/Utils/Cloning.h
+++ llvm/trunk/include/llvm/Transforms/Utils/Cloning.h
@@ -221,6 +221,7 @@
 ///
 /// Updates LoopInfo and DominatorTree assuming the loop is dominated by block
 /// \p LoopDomBB.  Insert the new blocks before block specified in \p Before.
+/// Note: Only innermost loops are supported.
 Loop *cloneLoopWithPreheader(BasicBlock *Before, BasicBlock *LoopDomBB,
                              Loop *OrigLoop, ValueToValueMapTy &VMap,
                              const Twine &NameSuffix, LoopInfo *LI,
Index: llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp
+++ llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp
@@ -672,6 +672,8 @@
                                    const Twine &NameSuffix, LoopInfo *LI,
                                    DominatorTree *DT,
                                    SmallVectorImpl<BasicBlock *> &Blocks) {
+  assert(OrigLoop->getSubLoops().empty() && 
+         "Loop to be cloned cannot have inner loop");
   Function *F = OrigLoop->getHeader()->getParent();
   Loop *ParentLoop = OrigLoop->getParentLoop();
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15922.55163.patch
Type: text/x-patch
Size: 1345 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160427/fc448dc8/attachment.bin>


More information about the llvm-commits mailing list