Lines Matching full:term

79   bool openIf(BranchInst *Term);
81 bool insertElse(BranchInst *Term);
85 BranchInst *Term);
87 bool handleLoop(BranchInst *Term);
205 bool SIAnnotateControlFlow::openIf(BranchInst *Term) { in openIf() argument
206 if (isUniform(Term)) in openIf()
209 IRBuilder<> IRB(Term); in openIf()
210 Value *IfCall = IRB.CreateCall(If, {Term->getCondition()}); in openIf()
213 Term->setCondition(Cond); in openIf()
214 push(Term->getSuccessor(1), Mask); in openIf()
219 bool SIAnnotateControlFlow::insertElse(BranchInst *Term) { in insertElse() argument
220 if (isUniform(Term)) { in insertElse()
224 IRBuilder<> IRB(Term); in insertElse()
228 Term->setCondition(Cond); in insertElse()
229 push(Term->getSuccessor(1), Mask); in insertElse()
235 Value *Cond, PHINode *Broken, llvm::Loop *L, BranchInst *Term) { in handleLoopCondition() argument
253 // Insert IfBreak in the loop header TERM for constant COND other than true. in handleLoopCondition()
256 Term : L->getHeader()->getTerminator(); in handleLoopCondition()
270 bool SIAnnotateControlFlow::handleLoop(BranchInst *Term) { in handleLoop() argument
271 if (isUniform(Term)) in handleLoop()
274 BasicBlock *BB = Term->getParent(); in handleLoop()
279 BasicBlock *Target = Term->getSuccessor(1); in handleLoop()
283 Value *Cond = Term->getCondition(); in handleLoop()
284 Term->setCondition(BoolTrue); in handleLoop()
285 Value *Arg = handleLoopCondition(Cond, Broken, L, Term); in handleLoop()
299 CallInst *LoopCall = IRBuilder<>(Term).CreateCall(Loop, {Arg}); in handleLoop()
300 Term->setCondition(LoopCall); in handleLoop()
302 push(Term->getSuccessor(0), Arg); in handleLoop()
364 BranchInst *Term = dyn_cast<BranchInst>(BB->getTerminator()); in runOnFunction() local
366 if (!Term || Term->isUnconditional()) { in runOnFunction()
373 if (I.nodeVisited(Term->getSuccessor(1))) { in runOnFunction()
377 if (DT->dominates(Term->getSuccessor(1), BB)) in runOnFunction()
378 Changed |= handleLoop(Term); in runOnFunction()
383 PHINode *Phi = dyn_cast<PHINode>(Term->getCondition()); in runOnFunction()
385 Changed |= insertElse(Term); in runOnFunction()
393 Changed |= openIf(Term); in runOnFunction()