[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 21:54:50 PDT 2016


vaivaswatha updated this revision to Diff 55162.
vaivaswatha updated the summary for this revision.
vaivaswatha added a comment.

Updating based on review comments


http://reviews.llvm.org/D15922

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

Index: lib/Transforms/Utils/CloneFunction.cpp
===================================================================
--- lib/Transforms/Utils/CloneFunction.cpp
+++ lib/Transforms/Utils/CloneFunction.cpp
@@ -707,6 +707,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();
 
Index: include/llvm/Transforms/Utils/Cloning.h
===================================================================
--- include/llvm/Transforms/Utils/Cloning.h
+++ 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,


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


More information about the llvm-commits mailing list