[PATCH] D15922: [NOP][Cloning] Add comment to cloneLoopWithPreheader() mentioningthat it does not update LoopInfo for sub-loops.

Vaivaswatha Nagaraj via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 6 05:58:02 PST 2016


vaivaswatha created this revision.
vaivaswatha added reviewers: ashutosh.nema, hfinkel.
vaivaswatha added a subscriber: llvm-commits.

cloneLoopWithPreheader() does not update LoopInfo for sub-loop of
the original loop being cloned. This is not documented in the
function comment.

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
@@ -750,6 +750,7 @@
 ///
 /// Updates LoopInfo and DominatorTree assuming the loop is dominated by block
 /// \p LoopDomBB.  Insert the new blocks before block specified in \p Before.
+/// If \p OrigLoop has sub-loops, LoopInfo for sub-loops are not updated.
 Loop *llvm::cloneLoopWithPreheader(BasicBlock *Before, BasicBlock *LoopDomBB,
                                    Loop *OrigLoop, ValueToValueMapTy &VMap,
                                    const Twine &NameSuffix, LoopInfo *LI,
Index: include/llvm/Transforms/Utils/Cloning.h
===================================================================
--- include/llvm/Transforms/Utils/Cloning.h
+++ include/llvm/Transforms/Utils/Cloning.h
@@ -251,6 +251,7 @@
 ///
 /// Updates LoopInfo and DominatorTree assuming the loop is dominated by block
 /// \p LoopDomBB.  Insert the new blocks before block specified in \p Before.
+/// If \p OrigLoop has sub-loops, LoopInfo for sub-loops are not updated.
 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.44111.patch
Type: text/x-patch
Size: 1365 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160106/2846e9c4/attachment.bin>


More information about the llvm-commits mailing list