Lines Matching defs:Phi
73 bool isElse(PHINode *Phi);
77 bool eraseIfUnused(PHINode *Phi);
170 bool SIAnnotateControlFlow::isElse(PHINode *Phi) {
171 BasicBlock *IDom = DT->getNode(Phi->getParent())->getIDom()->getBlock();
172 for (unsigned i = 0, e = Phi->getNumIncomingValues(); i != e; ++i) {
173 if (Phi->getIncomingBlock(i) == IDom) {
175 if (Phi->getIncomingValue(i) != BoolTrue)
179 if (Phi->getIncomingValue(i) != BoolFalse)
196 // Erase "Phi" if it is not used any more. Return true if any change was made.
197 bool SIAnnotateControlFlow::eraseIfUnused(PHINode *Phi) {
198 bool Changed = RecursivelyDeleteDeadPHINode(Phi);
383 PHINode *Phi = dyn_cast<PHINode>(Term->getCondition());
384 if (Phi && Phi->getParent() == BB && isElse(Phi) && !hasKill(BB)) {
386 Changed |= eraseIfUnused(Phi);