diff options
author | Vaivaswatha Nagaraj <vn@compilertree.com> | 2016-04-27 05:25:09 +0000 |
---|---|---|
committer | Vaivaswatha Nagaraj <vn@compilertree.com> | 2016-04-27 05:25:09 +0000 |
commit | 08efb0efcdacb079f0687ad94e64b2b85c6f051a (patch) | |
tree | edf6936c21ccd695824f5479006d36729593deb6 /llvm/lib/Transforms/Utils/CloneFunction.cpp | |
parent | de4318b9280127604ccbe0c1834b063c9b5006e0 (diff) | |
download | llvm-08efb0efcdacb079f0687ad94e64b2b85c6f051a.zip llvm-08efb0efcdacb079f0687ad94e64b2b85c6f051a.tar.gz llvm-08efb0efcdacb079f0687ad94e64b2b85c6f051a.tar.bz2 |
[Cloning] cloneLoopWithPreheader(): add assert to ensure no sub-loops
Summary:
cloneLoopWithPreheader() does not update LoopInfo for sub-loop of
the original loop being cloned. Add assert to ensure no sub-loops for loop being cloned.
Reviewers: anemet, ashutosh.nema, hfinkel
Subscribers: mzolotukhin, llvm-commits
Differential Revision: http://reviews.llvm.org/D15922
llvm-svn: 267671
Diffstat (limited to 'llvm/lib/Transforms/Utils/CloneFunction.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/CloneFunction.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp index f2d929f..c8d1212 100644 --- a/llvm/lib/Transforms/Utils/CloneFunction.cpp +++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp @@ -672,6 +672,8 @@ Loop *llvm::cloneLoopWithPreheader(BasicBlock *Before, BasicBlock *LoopDomBB, 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(); |