forked from OSchip/llvm-project
parent
385f2ec6d8
commit
d62691f4e8
|
@ -328,9 +328,8 @@ void LoopRotate::preserveCanonicalLoopForm(Loop *L, BasicBlock *OrigHeader,
|
||||||
BasicBlock *NewPreHeader =
|
BasicBlock *NewPreHeader =
|
||||||
BasicBlock::Create(OrigHeader->getContext(), "bb.nph",
|
BasicBlock::Create(OrigHeader->getContext(), "bb.nph",
|
||||||
OrigHeader->getParent(), NewHeader);
|
OrigHeader->getParent(), NewHeader);
|
||||||
LoopInfo &LI = getAnalysis<LoopInfo>();
|
if (Loop *PL = LI->getLoopFor(OrigPreHeader))
|
||||||
if (Loop *PL = LI.getLoopFor(OrigPreHeader))
|
PL->addBasicBlockToLoop(NewPreHeader, LI->getBase());
|
||||||
PL->addBasicBlockToLoop(NewPreHeader, LI.getBase());
|
|
||||||
BranchInst::Create(NewHeader, NewPreHeader);
|
BranchInst::Create(NewHeader, NewPreHeader);
|
||||||
|
|
||||||
BranchInst *OrigPH_BI = cast<BranchInst>(OrigPreHeader->getTerminator());
|
BranchInst *OrigPH_BI = cast<BranchInst>(OrigPreHeader->getTerminator());
|
||||||
|
|
Loading…
Reference in New Issue