Lines Matching refs:Term

79   bool openIf(BranchInst *Term);
81 bool insertElse(BranchInst *Term);
85 BranchInst *Term);
87 bool handleLoop(BranchInst *Term);
206 bool SIAnnotateControlFlow::openIf(BranchInst *Term) { in openIf() argument
207 if (isUniform(Term)) in openIf()
210 IRBuilder<> IRB(Term); in openIf()
211 Value *IfCall = IRB.CreateCall(If, {Term->getCondition()}); in openIf()
214 Term->setCondition(Cond); in openIf()
215 push(Term->getSuccessor(1), Mask); in openIf()
220 bool SIAnnotateControlFlow::insertElse(BranchInst *Term) { in insertElse() argument
221 if (isUniform(Term)) { in insertElse()
225 IRBuilder<> IRB(Term); in insertElse()
229 Term->setCondition(Cond); in insertElse()
230 push(Term->getSuccessor(1), Mask); in insertElse()
236 Value *Cond, PHINode *Broken, llvm::Loop *L, BranchInst *Term) { in handleLoopCondition() argument
257 Term : L->getHeader()->getTerminator(); in handleLoopCondition()
271 bool SIAnnotateControlFlow::handleLoop(BranchInst *Term) { in handleLoop() argument
272 if (isUniform(Term)) in handleLoop()
275 BasicBlock *BB = Term->getParent(); in handleLoop()
280 BasicBlock *Target = Term->getSuccessor(1); in handleLoop()
284 Value *Cond = Term->getCondition(); in handleLoop()
285 Term->setCondition(BoolTrue); in handleLoop()
286 Value *Arg = handleLoopCondition(Cond, Broken, L, Term); in handleLoop()
300 CallInst *LoopCall = IRBuilder<>(Term).CreateCall(Loop, {Arg}); in handleLoop()
301 Term->setCondition(LoopCall); in handleLoop()
303 push(Term->getSuccessor(0), Arg); in handleLoop()
361 BranchInst *Term = dyn_cast<BranchInst>(BB->getTerminator()); in runOnFunction() local
363 if (!Term || Term->isUnconditional()) { in runOnFunction()
370 if (I.nodeVisited(Term->getSuccessor(1))) { in runOnFunction()
374 if (DT->dominates(Term->getSuccessor(1), BB)) in runOnFunction()
375 Changed |= handleLoop(Term); in runOnFunction()
380 PHINode *Phi = dyn_cast<PHINode>(Term->getCondition()); in runOnFunction()
382 Changed |= insertElse(Term); in runOnFunction()
390 Changed |= openIf(Term); in runOnFunction()