Lines Matching refs:Phi
80 bool isElse(PHINode *Phi);
82 void eraseIfUnused(PHINode *Phi);
191 bool SIAnnotateControlFlow::isElse(PHINode *Phi) { in isElse() argument
192 BasicBlock *IDom = DT->getNode(Phi->getParent())->getIDom()->getBlock(); in isElse()
193 for (unsigned i = 0, e = Phi->getNumIncomingValues(); i != e; ++i) { in isElse()
194 if (Phi->getIncomingBlock(i) == IDom) { in isElse()
196 if (Phi->getIncomingValue(i) != BoolTrue) in isElse()
200 if (Phi->getIncomingValue(i) != BoolFalse) in isElse()
209 void SIAnnotateControlFlow::eraseIfUnused(PHINode *Phi) { in eraseIfUnused() argument
210 if (!Phi->hasNUsesOrMore(1)) in eraseIfUnused()
211 Phi->eraseFromParent(); in eraseIfUnused()
243 PHINode *Phi = nullptr; in handleLoopCondition() local
244 if ((Phi = dyn_cast<PHINode>(Cond)) && L->contains(Phi)) { in handleLoopCondition()
246 BasicBlock *Parent = Phi->getParent(); in handleLoopCondition()
251 for (unsigned i = 0, e = Phi->getNumIncomingValues(); i != e; ++i) { in handleLoopCondition()
252 Value *Incoming = Phi->getIncomingValue(i); in handleLoopCondition()
253 BasicBlock *From = Phi->getIncomingBlock(i); in handleLoopCondition()
259 Phi->setIncomingValue(i, BoolFalse); in handleLoopCondition()
266 for (unsigned i = 0, e = Phi->getNumIncomingValues(); i != e; ++i) { in handleLoopCondition()
268 Value *Incoming = Phi->getIncomingValue(i); in handleLoopCondition()
272 BasicBlock *From = Phi->getIncomingBlock(i); in handleLoopCondition()
301 eraseIfUnused(Phi); in handleLoopCondition()
404 PHINode *Phi = dyn_cast<PHINode>(Term->getCondition()); in runOnFunction() local
405 if (Phi && Phi->getParent() == *I && isElse(Phi)) { in runOnFunction()
407 eraseIfUnused(Phi); in runOnFunction()