Lines Matching defs:Term
81 bool openIf(BranchInst *Term);
83 bool insertElse(BranchInst *Term);
87 BranchInst *Term);
89 bool handleLoop(BranchInst *Term);
185 bool SIAnnotateControlFlow::openIf(BranchInst *Term) {
186 if (isUniform(Term))
189 IRBuilder<> IRB(Term);
191 {Term->getCondition()});
194 Term->setCondition(Cond);
195 push(Term->getSuccessor(1), Mask);
200 bool SIAnnotateControlFlow::insertElse(BranchInst *Term) {
201 if (isUniform(Term)) {
205 IRBuilder<> IRB(Term);
210 Term->setCondition(Cond);
211 push(Term->getSuccessor(1), Mask);
217 Value *Cond, PHINode *Broken, llvm::Loop *L, BranchInst *Term) {
233 Insert = Term;
244 Term : L->getHeader()->getTerminator();
258 bool SIAnnotateControlFlow::handleLoop(BranchInst *Term) {
259 if (isUniform(Term))
262 BasicBlock *BB = Term->getParent();
267 BasicBlock *Target = Term->getSuccessor(1);
271 Value *Cond = Term->getCondition();
272 Term->setCondition(BoolTrue);
273 Value *Arg = handleLoopCondition(Cond, Broken, L, Term);
287 CallInst *LoopCall = IRBuilder<>(Term).CreateCall(
289 Term->setCondition(LoopCall);
291 push(Term->getSuccessor(0), Arg);
348 BranchInst *Term = dyn_cast<BranchInst>(BB->getTerminator());
350 if (!Term || Term->isUnconditional()) {
357 if (I.nodeVisited(Term->getSuccessor(1))) {
361 if (DT->dominates(Term->getSuccessor(1), BB))
362 Changed |= handleLoop(Term);
367 PHINode *Phi = dyn_cast<PHINode>(Term->getCondition());
369 Changed |= insertElse(Term);
377 Changed |= openIf(Term);