Lines Matching refs:BB

67   bool isTopOfStack(BasicBlock *BB);
71 void push(BasicBlock *BB, Value *Saved);
75 bool hasKill(const BasicBlock *BB);
89 bool closeControlFlow(BasicBlock *BB);
155 bool SIAnnotateControlFlow::isTopOfStack(BasicBlock *BB) { in isTopOfStack() argument
156 return !Stack.empty() && Stack.back().first == BB; in isTopOfStack()
165 void SIAnnotateControlFlow::push(BasicBlock *BB, Value *Saved) { in push() argument
166 Stack.push_back(std::pair(BB, Saved)); in push()
188 bool SIAnnotateControlFlow::hasKill(const BasicBlock *BB) { in hasKill() argument
189 for (const Instruction &I : *BB) { in hasKill()
275 BasicBlock *BB = Term->getParent(); in handleLoop() local
276 llvm::Loop *L = LI->getLoopFor(BB); in handleLoop()
290 if (Pred == BB) // Remember the value of the previous iteration. in handleLoop()
295 else if (L->contains(Pred) && DT->dominates(Pred, BB)) in handleLoop()
309 bool SIAnnotateControlFlow::closeControlFlow(BasicBlock *BB) { in closeControlFlow() argument
310 llvm::Loop *L = LI->getLoopFor(BB); in closeControlFlow()
312 assert(Stack.back().first == BB); in closeControlFlow()
314 if (L && L->getHeader() == BB) { in closeControlFlow()
322 for (BasicBlock *Pred : predecessors(BB)) { in closeControlFlow()
327 BB = SplitBlockPredecessors(BB, Preds, "endcf.split", DT, LI, nullptr, in closeControlFlow()
332 BasicBlock::iterator FirstInsertionPt = BB->getFirstInsertionPt(); in closeControlFlow()
336 if (!DT->dominates(DefBB, BB)) { in closeControlFlow()
338 FirstInsertionPt = SplitEdge(DefBB, BB, DT, LI)->getFirstInsertionPt(); in closeControlFlow()
360 BasicBlock *BB = *I; in runOnFunction() local
361 BranchInst *Term = dyn_cast<BranchInst>(BB->getTerminator()); in runOnFunction()
364 if (isTopOfStack(BB)) in runOnFunction()
365 Changed |= closeControlFlow(BB); in runOnFunction()
371 if (isTopOfStack(BB)) in runOnFunction()
372 Changed |= closeControlFlow(BB); in runOnFunction()
374 if (DT->dominates(Term->getSuccessor(1), BB)) in runOnFunction()
379 if (isTopOfStack(BB)) { in runOnFunction()
381 if (Phi && Phi->getParent() == BB && isElse(Phi) && !hasKill(BB)) { in runOnFunction()
387 Changed |= closeControlFlow(BB); in runOnFunction()