forked from OSchip/llvm-project
[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
This commit is contained in:
parent
de4318b928
commit
08efb0efcd
|
@ -221,6 +221,7 @@ bool InlineFunction(CallSite CS, InlineFunctionInfo &IFI,
|
|||
///
|
||||
/// 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,
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue