Home | History | Annotate | Download | only in Scalar

Lines Matching defs:PHI

198 /// loop. For PHI nodes, there may be multiple uses, so compute the nearest
202 PHINode *PHI = dyn_cast<PHINode>(User);
203 if (!PHI)
207 for (unsigned i = 0, e = PHI->getNumIncomingValues(); i != e; ++i) {
208 if (PHI->getIncomingValue(i) != Def)
211 BasicBlock *InsertBB = PHI->getIncomingBlock(i);
219 assert(InsertPt && "Missing phi operand");
271 // If this is not an add of the PHI with a constantfp, or if the constant fp
449 // Add a new IVUsers entry for the newly-created integer PHI.
502 // Because of LCSSA, these values will only occur in LCSSA PHI Nodes. Scan
507 // If there are no PHI nodes in this exit block, then no values defined
514 // Iterate over all of the PHI nodes.
526 // watching the PHI itself. Once the new exit value is in place, there
531 // Iterate over all of the values in all the PHI nodes.
573 // Completely replace a single-pred PHI. This is safe, because the
574 // NewVal won't be variant in the loop, so we don't need an LCSSA phi
581 // Clone the PHI and delete the original one. This lets IVUsers and
677 // hoist loop invariants out of the loop. For PHI nodes, there may be
792 /// phi of the wider type and redirects all users, either removing extends or
831 assert(L->getHeader() == OrigPhi->getParent() && "Phi must be an IV");
1024 // new loop phi. If we preserved IVUsers analysis, we would also want to
1084 // Handle data flow merges and bizarre phi cycles.
1103 // Is this phi an induction variable?
1122 // materialized by a loop header phi, the expression cannot have any post-loop
1126 && "Loop header phi recurrence inputs do not dominate the loop");
1129 // either find an existing phi or materialize a new one. Either way, we
1130 // expect a well-formed cyclic phi-with-increments. i.e. any operand not part
1131 // of the phi-SCC dominates the loop entry.
1331 /// getLoopPhiForCounter - Return the loop header phi IFF IncV adds a loop
1332 /// invariant value to the phi.
1350 PHINode *Phi = dyn_cast<PHINode>(IncI->getOperand(0));
1351 if (Phi && Phi->getParent() == L->getHeader()) {
1353 return Phi;
1360 Phi = dyn_cast<PHINode>(IncI->getOperand(1));
1361 if (Phi && Phi->getParent() == L->getHeader()) {
1363 return Phi;
1400 PHINode *Phi = dyn_cast<PHINode>(LHS);
1401 if (!Phi)
1402 Phi = getLoopPhiForCounter(LHS, L, DT);
1404 if (!Phi)
1408 Value *IncV = Phi->getIncomingValueForBlock(L->getLoopLatch());
1409 return Phi != getLoopPhiForCounter(IncV, L, DT);
1414 static bool AlmostDeadIV(PHINode *Phi, BasicBlock *LatchBlock, Value *Cond) {
1415 int LatchIdx = Phi->getBasicBlockIndex(LatchBlock);
1416 Value *IncV = Phi->getIncomingValue(LatchIdx);
1418 for (Value::use_iterator UI = Phi->use_begin(), UE = Phi->use_end();
1425 if (*UI != Cond && *UI != Phi) return false;
1450 // Loop over all of the PHI nodes, looking for a simple counter.
1457 PHINode *Phi = cast<PHINode>(I);
1458 if (!SE->isSCEVable(Phi->getType()))
1461 const SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(SE->getSCEV(Phi));
1476 int LatchIdx = Phi->getBasicBlockIndex(LatchBlock);
1477 Value *IncV = Phi->getIncomingValue(LatchIdx);
1478 if (getLoopPhiForCounter(IncV, L, DT) != Phi)
1485 if (AlmostDeadIV(Phi, LatchBlock, Cond))
1495 // narrower is likely a dead phi that has been widened. Use the wider phi
1500 BestPhi = Phi;
1860 // consistent. They will be deleted as part of the dead-PHI deletion at