Home | History | Annotate | Download | only in AMDGPU

Lines Matching refs:Phi

80   bool isElse(PHINode *Phi);
82 void eraseIfUnused(PHINode *Phi);
189 /// \brief Can the condition represented by this PHI node treated like
191 bool SIAnnotateControlFlow::isElse(PHINode *Phi) {
192 BasicBlock *IDom = DT->getNode(Phi->getParent())->getIDom()->getBlock();
193 for (unsigned i = 0, e = Phi->getNumIncomingValues(); i != e; ++i) {
194 if (Phi->getIncomingBlock(i) == IDom) {
196 if (Phi->getIncomingValue(i) != BoolTrue)
200 if (Phi->getIncomingValue(i) != BoolFalse)
208 // \brief Erase "Phi" if it is not used any more
209 void SIAnnotateControlFlow::eraseIfUnused(PHINode *Phi) {
210 if (!Phi->hasNUsesOrMore(1))
211 Phi->eraseFromParent();
238 // Only search through PHI nodes which are inside the loop. If we try this
239 // with PHI nodes that are outside of the loop, we end up inserting new PHI
243 PHINode *Phi = nullptr;
244 if ((Phi = dyn_cast<PHINode>(Cond)) && L->contains(Phi)) {
246 BasicBlock *Parent = Phi->getParent();
251 for (unsigned i = 0, e = Phi->getNumIncomingValues(); i != e; ++i) {
252 Value *Incoming = Phi->getIncomingValue(i);
253 BasicBlock *From = Phi->getIncomingBlock(i);
259 Phi->setIncomingValue(i, BoolFalse);
266 for (unsigned i = 0, e = Phi->getNumIncomingValues(); i != e; ++i) {
268 Value *Incoming = Phi->getIncomingValue(i);
272 BasicBlock *From = Phi->getIncomingBlock(i);
284 // Note that the end.cf need not be the first non-phi instruction
301 eraseIfUnused(Phi);
404 PHINode *Phi = dyn_cast<PHINode>(Term->getCondition());
405 if (Phi && Phi->getParent() == *I && isElse(Phi)) {
407 eraseIfUnused(Phi);