Home | History | Annotate | Download | only in R600

Lines Matching full:phi

75   bool isElse(PHINode *Phi);
77 void eraseIfUnused(PHINode *Phi);
166 /// \brief Can the condition represented by this PHI node treated like
168 bool SIAnnotateControlFlow::isElse(PHINode *Phi) {
169 BasicBlock *IDom = DT->getNode(Phi->getParent())->getIDom()->getBlock();
170 for (unsigned i = 0, e = Phi->getNumIncomingValues(); i != e; ++i) {
171 if (Phi->getIncomingBlock(i) == IDom) {
173 if (Phi->getIncomingValue(i) != BoolTrue)
177 if (Phi->getIncomingValue(i) != BoolFalse)
185 // \brief Erase "Phi" if it is not used any more
186 void SIAnnotateControlFlow::eraseIfUnused(PHINode *Phi) {
187 if (!Phi->hasNUsesOrMore(1))
188 Phi->eraseFromParent();
207 if (PHINode *Phi = dyn_cast<PHINode>(Cond)) {
208 BasicBlock *Parent = Phi->getParent();
213 for (unsigned i = 0, e = Phi->getNumIncomingValues(); i != e; ++i) {
214 Value *Incoming = Phi->getIncomingValue(i);
215 BasicBlock *From = Phi->getIncomingBlock(i);
221 Phi->setIncomingValue(i, BoolFalse);
228 for (unsigned i = 0, e = Phi->getNumIncomingValues(); i != e; ++i) {
230 Value *Incoming = Phi->getIncomingValue(i);
234 BasicBlock *From = Phi->getIncomingBlock(i);
247 eraseIfUnused(Phi);
311 PHINode *Phi = dyn_cast<PHINode>(Term->getCondition());
312 if (Phi && Phi->getParent() == *I && isElse(Phi)) {
314 eraseIfUnused(Phi);