• Home
  • Raw
  • Download

Lines Matching refs:BB

35 void llvm::DeleteDeadBlock(BasicBlock *BB) {  in DeleteDeadBlock()  argument
36 assert((pred_begin(BB) == pred_end(BB) || in DeleteDeadBlock()
38 BB->getSinglePredecessor() == BB) && "Block is not dead!"); in DeleteDeadBlock()
39 TerminatorInst *BBTerm = BB->getTerminator(); in DeleteDeadBlock()
44 BBTerm->getSuccessor(i)->removePredecessor(BB); in DeleteDeadBlock()
47 while (!BB->empty()) { in DeleteDeadBlock()
48 Instruction &I = BB->back(); in DeleteDeadBlock()
56 BB->getInstList().pop_back(); in DeleteDeadBlock()
60 BB->eraseFromParent(); in DeleteDeadBlock()
67 void llvm::FoldSingleEntryPHINodes(BasicBlock *BB, Pass *P) { in FoldSingleEntryPHINodes() argument
68 if (!isa<PHINode>(BB->begin())) return; in FoldSingleEntryPHINodes()
77 while (PHINode *PN = dyn_cast<PHINode>(BB->begin())) { in FoldSingleEntryPHINodes()
97 bool llvm::DeleteDeadPHIs(BasicBlock *BB) { in DeleteDeadPHIs() argument
101 for (BasicBlock::iterator I = BB->begin(); in DeleteDeadPHIs()
115 bool llvm::MergeBlockIntoPredecessor(BasicBlock *BB, Pass *P) { in MergeBlockIntoPredecessor() argument
117 if (BB->hasAddressTaken()) return false; in MergeBlockIntoPredecessor()
120 BasicBlock *PredBB = BB->getUniquePredecessor(); in MergeBlockIntoPredecessor()
124 if (PredBB == BB) return false; in MergeBlockIntoPredecessor()
129 BasicBlock *OnlySucc = BB; in MergeBlockIntoPredecessor()
140 for (BasicBlock::iterator BI = BB->begin(), BE = BB->end(); BI != BE; ++BI) { in MergeBlockIntoPredecessor()
150 if (isa<PHINode>(BB->front())) in MergeBlockIntoPredecessor()
151 FoldSingleEntryPHINodes(BB, P); in MergeBlockIntoPredecessor()
158 BB->replaceAllUsesWith(PredBB); in MergeBlockIntoPredecessor()
161 PredBB->getInstList().splice(PredBB->end(), BB->getInstList()); in MergeBlockIntoPredecessor()
165 PredBB->takeName(BB); in MergeBlockIntoPredecessor()
170 if (DomTreeNode *DTN = DT->getNode(BB)) { in MergeBlockIntoPredecessor()
177 DT->eraseNode(BB); in MergeBlockIntoPredecessor()
181 LI->removeBlock(BB); in MergeBlockIntoPredecessor()
189 BB->eraseFromParent(); in MergeBlockIntoPredecessor()
242 unsigned llvm::GetSuccessorNumber(BasicBlock *BB, BasicBlock *Succ) { in GetSuccessorNumber() argument
243 TerminatorInst *Term = BB->getTerminator(); in GetSuccessorNumber()
256 BasicBlock *llvm::SplitEdge(BasicBlock *BB, BasicBlock *Succ, Pass *P) { in SplitEdge() argument
257 unsigned SuccNum = GetSuccessorNumber(BB, Succ); in SplitEdge()
260 TerminatorInst *LatchTerm = BB->getTerminator(); in SplitEdge()
270 assert(SP == BB && "CFG broken"); in SplitEdge()
277 assert(BB->getTerminator()->getNumSuccessors() == 1 && in SplitEdge()
279 return SplitBlock(BB, BB->getTerminator(), P); in SplitEdge()
454 BasicBlock *llvm::SplitBlockPredecessors(BasicBlock *BB, in SplitBlockPredecessors() argument
458 BasicBlock *NewBB = BasicBlock::Create(BB->getContext(), BB->getName()+Suffix, in SplitBlockPredecessors()
459 BB->getParent(), BB); in SplitBlockPredecessors()
462 BranchInst *BI = BranchInst::Create(BB, NewBB); in SplitBlockPredecessors()
471 Preds[i]->getTerminator()->replaceUsesOfWith(BB, NewBB); in SplitBlockPredecessors()
480 for (BasicBlock::iterator I = BB->begin(); isa<PHINode>(I); ++I) in SplitBlockPredecessors()
487 UpdateAnalysisInformation(BB, NewBB, Preds, P, HasLoopExit); in SplitBlockPredecessors()
490 UpdatePHINodes(BB, NewBB, Preds, BI, P, HasLoopExit); in SplitBlockPredecessors()
608 const BasicBlock *BB = &F.getEntryBlock(); in FindFunctionBackedges() local
609 if (succ_begin(BB) == succ_end(BB)) in FindFunctionBackedges()
616 Visited.insert(BB); in FindFunctionBackedges()
617 VisitStack.push_back(std::make_pair(BB, succ_begin(BB))); in FindFunctionBackedges()
618 InStack.insert(BB); in FindFunctionBackedges()
626 BB = *I++; in FindFunctionBackedges()
627 if (Visited.insert(BB)) { in FindFunctionBackedges()
632 if (InStack.count(BB)) in FindFunctionBackedges()
633 Result.push_back(std::make_pair(ParentBB, BB)); in FindFunctionBackedges()
638 InStack.insert(BB); in FindFunctionBackedges()
639 VisitStack.push_back(std::make_pair(BB, succ_begin(BB))); in FindFunctionBackedges()
652 ReturnInst *llvm::FoldReturnIntoUncondBranch(ReturnInst *RI, BasicBlock *BB, in FoldReturnIntoUncondBranch() argument
664 if (PN->getParent() == BB) in FoldReturnIntoUncondBranch()
669 BB->removePredecessor(Pred); in FoldReturnIntoUncondBranch()
676 DebugLoc llvm::GetFirstDebugLocInBasicBlock(const BasicBlock *BB) { in GetFirstDebugLocInBasicBlock() argument
677 if (const Instruction *I = BB->getFirstNonPHI()) in GetFirstDebugLocInBasicBlock()