Lines Matching full:term
76 void openIf(BranchInst *Term);
78 void insertElse(BranchInst *Term);
82 void handleLoop(BranchInst *Term);
189 void SIAnnotateControlFlow::openIf(BranchInst *Term) {
190 Value *Ret = CallInst::Create(If, Term->getCondition(), "", Term);
191 Term->setCondition(ExtractValueInst::Create(Ret, 0, "", Term));
192 push(Term->getSuccessor(1), ExtractValueInst::Create(Ret, 1, "", Term));
196 void SIAnnotateControlFlow::insertElse(BranchInst *Term) {
197 Value *Ret = CallInst::Create(Else, popSaved(), "", Term);
198 Term->setCondition(ExtractValueInst::Create(Ret, 0, "", Term));
199 push(Term->getSuccessor(1), ExtractValueInst::Create(Ret, 1, "", Term));
259 void SIAnnotateControlFlow::handleLoop(BranchInst *Term) {
260 BasicBlock *Target = Term->getSuccessor(1);
266 Value *Cond = Term->getCondition();
267 Term->setCondition(BoolTrue);
270 BasicBlock *BB = Term->getParent();
278 Term->setCondition(CallInst::Create(Loop, Arg, "", Term));
279 push(Term->getSuccessor(0), Arg);
295 BranchInst *Term = dyn_cast<BranchInst>((*I)->getTerminator());
297 if (!Term || Term->isUnconditional()) {
303 if (I.nodeVisited(Term->getSuccessor(1))) {
306 handleLoop(Term);
311 PHINode *Phi = dyn_cast<PHINode>(Term->getCondition());
313 insertElse(Term);
319 openIf(Term);