Lines Matching defs:Phi
75 bool isElse(PHINode *Phi);
79 bool eraseIfUnused(PHINode *Phi);
150 bool SIAnnotateControlFlow::isElse(PHINode *Phi) {
151 BasicBlock *IDom = DT->getNode(Phi->getParent())->getIDom()->getBlock();
152 for (unsigned i = 0, e = Phi->getNumIncomingValues(); i != e; ++i) {
153 if (Phi->getIncomingBlock(i) == IDom) {
155 if (Phi->getIncomingValue(i) != BoolTrue)
159 if (Phi->getIncomingValue(i) != BoolFalse)
176 // Erase "Phi" if it is not used any more. Return true if any change was made.
177 bool SIAnnotateControlFlow::eraseIfUnused(PHINode *Phi) {
178 bool Changed = RecursivelyDeleteDeadPHINode(Phi);
367 PHINode *Phi = dyn_cast<PHINode>(Term->getCondition());
368 if (Phi && Phi->getParent() == BB && isElse(Phi) && !hasKill(BB)) {
370 Changed |= eraseIfUnused(Phi);