Lines Matching defs:Term
82 void openIf(BranchInst *Term);
84 void insertElse(BranchInst *Term);
88 void handleLoop(BranchInst *Term);
196 void SIAnnotateControlFlow::openIf(BranchInst *Term) {
197 Value *Ret = CallInst::Create(If, Term->getCondition(), "", Term);
198 Term->setCondition(ExtractValueInst::Create(Ret, 0, "", Term));
199 push(Term->getSuccessor(1), ExtractValueInst::Create(Ret, 1, "", Term));
203 void SIAnnotateControlFlow::insertElse(BranchInst *Term) {
204 Value *Ret = CallInst::Create(Else, popSaved(), "", Term);
205 Term->setCondition(ExtractValueInst::Create(Ret, 0, "", Term));
206 push(Term->getSuccessor(1), ExtractValueInst::Create(Ret, 1, "", Term));
281 void SIAnnotateControlFlow::handleLoop(BranchInst *Term) {
282 BasicBlock *BB = Term->getParent();
284 BasicBlock *Target = Term->getSuccessor(1);
287 Value *Cond = Term->getCondition();
288 Term->setCondition(BoolTrue);
297 Term->setCondition(CallInst::Create(Loop, Arg, "", Term));
298 push(Term->getSuccessor(0), Arg);
330 BranchInst *Term = dyn_cast<BranchInst>((*I)->getTerminator());
332 if (!Term || Term->isUnconditional()) {
338 if (I.nodeVisited(Term->getSuccessor(1))) {
341 handleLoop(Term);
346 PHINode *Phi = dyn_cast<PHINode>(Term->getCondition());
348 insertElse(Term);
354 openIf(Term);