Lines Matching full:bb

67   bool isTopOfStack(BasicBlock *BB);
71 void push(BasicBlock *BB, Value *Saved);
75 bool hasKill(const BasicBlock *BB);
89 bool closeControlFlow(BasicBlock *BB);
153 /// Is BB the last block saved on the stack ?
154 bool SIAnnotateControlFlow::isTopOfStack(BasicBlock *BB) { in isTopOfStack() argument
155 return !Stack.empty() && Stack.back().first == BB; in isTopOfStack()
163 /// Push a BB and saved value to the control flow stack
164 void SIAnnotateControlFlow::push(BasicBlock *BB, Value *Saved) { in push() argument
165 Stack.push_back(std::pair(BB, Saved)); in push()
187 bool SIAnnotateControlFlow::hasKill(const BasicBlock *BB) { in hasKill() argument
188 for (const Instruction &I : *BB) { in hasKill()
274 BasicBlock *BB = Term->getParent(); in handleLoop() local
275 llvm::Loop *L = LI->getLoopFor(BB); in handleLoop()
289 if (Pred == BB) // Remember the value of the previous iteration. in handleLoop()
292 // of the loop at BB, it should not reset or change "Broken", which keeps in handleLoop()
293 // track of the number of threads exited the loop at BB. in handleLoop()
294 else if (L->contains(Pred) && DT->dominates(Pred, BB)) in handleLoop()
308 bool SIAnnotateControlFlow::closeControlFlow(BasicBlock *BB) { in closeControlFlow() argument
309 llvm::Loop *L = LI->getLoopFor(BB); in closeControlFlow()
311 assert(Stack.back().first == BB); in closeControlFlow()
313 if (L && L->getHeader() == BB) { in closeControlFlow()
321 for (BasicBlock *Pred : predecessors(BB)) { in closeControlFlow()
326 BB = SplitBlockPredecessors(BB, Preds, "endcf.split", DT, LI, nullptr, in closeControlFlow()
331 BasicBlock::iterator FirstInsertionPt = BB->getFirstInsertionPt(); in closeControlFlow()
335 if (!DT->dominates(DefBB, BB)) { in closeControlFlow()
337 FirstInsertionPt = SplitEdge(DefBB, BB, DT, LI)->getFirstInsertionPt(); in closeControlFlow()
363 BasicBlock *BB = *I; in runOnFunction() local
364 BranchInst *Term = dyn_cast<BranchInst>(BB->getTerminator()); in runOnFunction()
367 if (isTopOfStack(BB)) in runOnFunction()
368 Changed |= closeControlFlow(BB); in runOnFunction()
374 if (isTopOfStack(BB)) in runOnFunction()
375 Changed |= closeControlFlow(BB); in runOnFunction()
377 if (DT->dominates(Term->getSuccessor(1), BB)) in runOnFunction()
382 if (isTopOfStack(BB)) { in runOnFunction()
384 if (Phi && Phi->getParent() == BB && isElse(Phi) && !hasKill(BB)) { in runOnFunction()
390 Changed |= closeControlFlow(BB); in runOnFunction()