Home | History | Annotate | Download | only in Analysis

Lines Matching refs:Phi

862 /// the PHI. If so, it may be reused by expanded expressions.
962 // Check that the chain of IV operands leading back to Phi can be hoisted.
981 /// Determine if this cyclic phi is in a form that would have been generated by
982 /// LSR. We don't care if the phi was actually expanded in this pass, as long
1004 // If the PHI is a pointer, use a GEP, otherwise use an add or sub.
1029 /// values, and return the PHI.
1037 // Reuse a previously-inserted PHI, if present.
1072 // Remember this PHI, even in post-inc mode.
1098 // StartV must be hoisted into L's preheader to dominate the new phi.
1103 // Expand code for the step value. Do this before creating the PHI so that PHI
1104 // reuse code doesn't see an incomplete PHI.
1115 // Create the PHI.
1123 // Create the step instructions and populate the PHI.
1133 // Create a step value and add it to the PHI.
1152 // Remember this PHI, even in post-inc mode.
1226 // all cases. Consider a phi outide whose operand is replaced during
1338 // Create and insert the PHI node for the induction variable in the
1606 PHINode *Phi = dyn_cast<PHINode>(I); ++I) {
1607 Phis.push_back(Phi);
1618 PHINode *Phi = *PIter;
1622 if (Value *V = Phi->hasConstantValue()) {
1623 Phi->replaceAllUsesWith(V);
1624 DeadInsts.push_back(Phi);
1627 << "INDVARS: Eliminated constant iv: " << *Phi << '\n');
1631 if (!SE.isSCEVable(Phi->getType()))
1634 PHINode *&OrigPhiRef = ExprToIVMap[SE.getSCEV(Phi)];
1636 OrigPhiRef = Phi;
1637 if (Phi->getType()->isIntegerTy() && TTI
1638 && TTI->isTruncateFree(Phi->getType(), Phis.back()->getType())) {
1639 // This phi can be freely truncated to the narrowest phi type. Map the
1642 SE.getTruncateExpr(SE.getSCEV(Phi), Phis.back()->getType());
1643 ExprToIVMap[TruncExpr] = Phi;
1648 // Replacing a pointer phi with an integer phi or vice-versa doesn't make
1650 if (OrigPhiRef->getType()->isPointerTy() != Phi->getType()->isPointerTy())
1657 cast<Instruction>(Phi->getIncomingValueForBlock(LatchBlock));
1659 // If this phi has the same width but is more canonical, replace the
1662 if (OrigPhiRef->getType() == Phi->getType()
1663 && !(ChainedPhis.count(Phi)
1665 && (ChainedPhis.count(Phi)
1666 || isExpandedAddRecExprPHI(Phi, IsomorphicInc, L))) {
1667 std::swap(OrigPhiRef, Phi);
1670 // Replacing the congruent phi is sufficient because acyclic redundancy
1672 // that a phi is congruent, it's often the head of an IV user cycle that
1673 // is isomorphic with the original phi. It's worth eagerly cleaning up the
1700 << "INDVARS: Eliminated congruent iv: " << *Phi << '\n');
1703 if (OrigPhiRef->getType() != Phi->getType()) {
1705 Builder.SetCurrentDebugLocation(Phi->getDebugLoc());
1706 NewIV = Builder.CreateTruncOrBitCast(OrigPhiRef, Phi->getType(), IVName);
1708 Phi->replaceAllUsesWith(NewIV);
1709 DeadInsts.push_back(Phi);