Lines Matching defs:Term
78 void openIf(BranchInst *Term);
80 void insertElse(BranchInst *Term);
84 void handleLoop(BranchInst *Term);
191 void SIAnnotateControlFlow::openIf(BranchInst *Term) {
192 Value *Ret = CallInst::Create(If, Term->getCondition(), "", Term);
193 Term->setCondition(ExtractValueInst::Create(Ret, 0, "", Term));
194 push(Term->getSuccessor(1), ExtractValueInst::Create(Ret, 1, "", Term));
198 void SIAnnotateControlFlow::insertElse(BranchInst *Term) {
199 Value *Ret = CallInst::Create(Else, popSaved(), "", Term);
200 Term->setCondition(ExtractValueInst::Create(Ret, 0, "", Term));
201 push(Term->getSuccessor(1), ExtractValueInst::Create(Ret, 1, "", Term));
261 void SIAnnotateControlFlow::handleLoop(BranchInst *Term) {
262 BasicBlock *Target = Term->getSuccessor(1);
268 Value *Cond = Term->getCondition();
269 Term->setCondition(BoolTrue);
272 BasicBlock *BB = Term->getParent();
280 Term->setCondition(CallInst::Create(Loop, Arg, "", Term));
281 push(Term->getSuccessor(0), Arg);
297 BranchInst *Term = dyn_cast<BranchInst>((*I)->getTerminator());
299 if (!Term || Term->isUnconditional()) {
305 if (I.nodeVisited(Term->getSuccessor(1))) {
308 handleLoop(Term);
313 PHINode *Phi = dyn_cast<PHINode>(Term->getCondition());
315 insertElse(Term);
321 openIf(Term);