Lines Matching defs:Phi
662 /// loop, return the associated Phi node if so. Otherwise, return null. Note
682 PHINode *Phi = dyn_cast<PHINode>(IncI->getOperand(0));
683 if (Phi && Phi->getParent() == L->getHeader()) {
685 return Phi;
692 Phi = dyn_cast<PHINode>(IncI->getOperand(1));
693 if (Phi && Phi->getParent() == L->getHeader()) {
695 return Phi;
745 PHINode *Phi = dyn_cast<PHINode>(LHS);
746 if (!Phi)
747 Phi = getLoopPhiForCounter(LHS, L);
749 if (!Phi)
753 int Idx = Phi->getBasicBlockIndex(L->getLoopLatch());
758 Value *IncV = Phi->getIncomingValue(Idx);
759 return Phi != getLoopPhiForCounter(IncV, L);
807 static bool isLoopCounter(PHINode* Phi, Loop *L,
809 assert(Phi->getParent() == L->getHeader());
812 if (!SE->isSCEVable(Phi->getType()))
815 const SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(SE->getSCEV(Phi));
823 int LatchIdx = Phi->getBasicBlockIndex(L->getLoopLatch());
824 Value *IncV = Phi->getIncomingValue(LatchIdx);
825 return (getLoopPhiForCounter(IncV, L) == Phi &&
851 PHINode *Phi = cast<PHINode>(I);
852 if (!isLoopCounter(Phi, L, SE))
855 const auto *AR = cast<SCEVAddRecExpr>(SE->getSCEV(Phi));
866 if (!hasConcreteDef(Phi)) {
870 Value *IncPhi = Phi->getIncomingValueForBlock(LatchBlock);
871 if (!isLoopExitTestBasedOn(Phi, ExitingBB) &&
884 if (!Phi->getType()->isIntegerTy() &&
885 !mustExecuteUBIfPoisonOnPathTo(Phi, ExitingBB->getTerminator(), DT))
892 if (isAlmostDeadIV(Phi, LatchBlock, Cond))
907 BestPhi = Phi;