Home | History | Annotate | Download | only in AMDGPU

Lines Matching refs:Phi

78   bool isElse(PHINode *Phi);
80 void eraseIfUnused(PHINode *Phi);
170 /// \brief Can the condition represented by this PHI node treated like
172 bool SIAnnotateControlFlow::isElse(PHINode *Phi) {
173 BasicBlock *IDom = DT->getNode(Phi->getParent())->getIDom()->getBlock();
174 for (unsigned i = 0, e = Phi->getNumIncomingValues(); i != e; ++i) {
175 if (Phi->getIncomingBlock(i) == IDom) {
177 if (Phi->getIncomingValue(i) != BoolTrue)
181 if (Phi->getIncomingValue(i) != BoolFalse)
189 // \brief Erase "Phi" if it is not used any more
190 void SIAnnotateControlFlow::eraseIfUnused(PHINode *Phi) {
191 if (!Phi->hasNUsesOrMore(1))
192 Phi->eraseFromParent();
213 // Only search through PHI nodes which are inside the loop. If we try this
214 // with PHI nodes that are outside of the loop, we end up inserting new PHI
218 PHINode *Phi = nullptr;
219 if ((Phi = dyn_cast<PHINode>(Cond)) && L->contains(Phi)) {
221 BasicBlock *Parent = Phi->getParent();
226 for (unsigned i = 0, e = Phi->getNumIncomingValues(); i != e; ++i) {
227 Value *Incoming = Phi->getIncomingValue(i);
228 BasicBlock *From = Phi->getIncomingBlock(i);
234 Phi->setIncomingValue(i, BoolFalse);
241 for (unsigned i = 0, e = Phi->getNumIncomingValues(); i != e; ++i) {
243 Value *Incoming = Phi->getIncomingValue(i);
247 BasicBlock *From = Phi->getIncomingBlock(i);
260 eraseIfUnused(Phi);
346 PHINode *Phi = dyn_cast<PHINode>(Term->getCondition());
347 if (Phi && Phi->getParent() == *I && isElse(Phi)) {
349 eraseIfUnused(Phi);