Lines Matching refs:Term
90 void openIf(BranchInst *Term);
92 void insertElse(BranchInst *Term);
96 BranchInst *Term);
98 void handleLoop(BranchInst *Term);
204 void SIAnnotateControlFlow::openIf(BranchInst *Term) { in openIf() argument
205 if (isUniform(Term)) in openIf()
208 Value *Ret = CallInst::Create(If, Term->getCondition(), "", Term); in openIf()
209 Term->setCondition(ExtractValueInst::Create(Ret, 0, "", Term)); in openIf()
210 push(Term->getSuccessor(1), ExtractValueInst::Create(Ret, 1, "", Term)); in openIf()
214 void SIAnnotateControlFlow::insertElse(BranchInst *Term) { in insertElse() argument
215 if (isUniform(Term)) { in insertElse()
218 Value *Ret = CallInst::Create(Else, popSaved(), "", Term); in insertElse()
219 Term->setCondition(ExtractValueInst::Create(Ret, 0, "", Term)); in insertElse()
220 push(Term->getSuccessor(1), ExtractValueInst::Create(Ret, 1, "", Term)); in insertElse()
225 Value *Cond, PHINode *Broken, llvm::Loop *L, BranchInst *Term) { in handleLoopCondition() argument
242 Term : L->getHeader()->getTerminator(); in handleLoopCondition()
252 void SIAnnotateControlFlow::handleLoop(BranchInst *Term) { in handleLoop() argument
253 if (isUniform(Term)) in handleLoop()
256 BasicBlock *BB = Term->getParent(); in handleLoop()
261 BasicBlock *Target = Term->getSuccessor(1); in handleLoop()
264 Value *Cond = Term->getCondition(); in handleLoop()
265 Term->setCondition(BoolTrue); in handleLoop()
266 Value *Arg = handleLoopCondition(Cond, Broken, L, Term); in handleLoop()
271 Term->setCondition(CallInst::Create(Loop, Arg, "", Term)); in handleLoop()
273 push(Term->getSuccessor(0), Arg); in handleLoop()
315 BranchInst *Term = dyn_cast<BranchInst>(BB->getTerminator()); in runOnFunction() local
317 if (!Term || Term->isUnconditional()) { in runOnFunction()
324 if (I.nodeVisited(Term->getSuccessor(1))) { in runOnFunction()
328 handleLoop(Term); in runOnFunction()
333 PHINode *Phi = dyn_cast<PHINode>(Term->getCondition()); in runOnFunction()
335 insertElse(Term); in runOnFunction()
343 openIf(Term); in runOnFunction()