Lines Matching refs:Latch
594 BasicBlock *Latch = L->getLoopLatch(); in simplifyLoopLatch() local
595 if (!Latch || Latch->hasAddressTaken()) in simplifyLoopLatch()
598 BranchInst *Jmp = dyn_cast<BranchInst>(Latch->getTerminator()); in simplifyLoopLatch()
602 BasicBlock *LastExit = Latch->getSinglePredecessor(); in simplifyLoopLatch()
610 if (!shouldSpeculateInstrs(Latch->begin(), Jmp->getIterator(), L)) in simplifyLoopLatch()
613 LLVM_DEBUG(dbgs() << "Folding loop latch " << Latch->getName() << " into " in simplifyLoopLatch()
617 Instruction *FirstLatchInst = &*(Latch->begin()); in simplifyLoopLatch()
618 LastExit->getInstList().splice(BI->getIterator(), Latch->getInstList(), in simplifyLoopLatch()
619 Latch->begin(), Jmp->getIterator()); in simplifyLoopLatch()
623 MSSAU->moveAllAfterMergeBlocks(Latch, LastExit, FirstLatchInst); in simplifyLoopLatch()
625 unsigned FallThruPath = BI->getSuccessor(0) == Latch ? 0 : 1; in simplifyLoopLatch()
631 Latch->replaceSuccessorsPhiUsesWith(LastExit); in simplifyLoopLatch()
635 assert(Latch->empty() && "unable to evacuate Latch"); in simplifyLoopLatch()
636 LI->removeBlock(Latch); in simplifyLoopLatch()
638 DT->eraseNode(Latch); in simplifyLoopLatch()
639 Latch->eraseFromParent(); in simplifyLoopLatch()