Home | History | Annotate | Download | only in Analysis

Lines Matching defs:Phi

817 /// the PHI. If so, it may be reused by expanded expressions.
917 // Check that the chain of IV operands leading back to Phi can be hoisted.
936 /// Determine if this cyclic phi is in a form that would have been generated by
937 /// LSR. We don't care if the phi was actually expanded in this pass, as long
959 // If the PHI is a pointer, use a GEP, otherwise use an add or sub.
982 /// \brief Hoist the addrec instruction chain rooted in the loop phi above the
998 /// the available PHI SCEV by truncation and/or invertion of the step.
1000 const SCEVAddRecExpr *Phi,
1003 Type *PhiTy = SE.getEffectiveSCEVType(Phi->getType());
1010 Phi = dyn_cast<SCEVAddRecExpr>(SE.getTruncateOrNoop(Phi, RequestedTy));
1011 if (!Phi)
1015 if (Phi == Requested) {
1022 SE.getNegativeSCEV(Requested)) == Phi) {
1060 /// values, and return the PHI.
1070 // Reuse a previously-inserted PHI, if present.
1093 // We only handle truncation and inversion of phi recurrences for the
1102 // Check whether we can reuse this PHI node.
1122 // Try whether the phi can be translated into the requested form
1126 // Record the phi node. But don't stop we might find an exact match
1141 // Remember this PHI, even in post-inc mode.
1166 // StartV must be hoisted into L's preheader to dominate the new phi.
1171 // Expand code for the step value. Do this before creating the PHI so that PHI
1172 // reuse code doesn't see an incomplete PHI.
1189 // Create the PHI.
1197 // Create the step instructions and populate the PHI.
1207 // Create a step value and add it to the PHI.
1228 // Remember this PHI, even in post-inc mode.
1277 // In some cases, we decide to reuse an existing phi node but need to truncate
1304 // all cases. Consider a phi outide whose operand is replaced during
1433 // Create and insert the PHI node for the induction variable in the
1691 PHINode *Phi = dyn_cast<PHINode>(I); ++I) {
1692 Phis.push_back(Phi);
1709 PHINode *Phi = *PIter;
1713 if (Value *V = SimplifyInstruction(Phi, DL, SE.TLI, SE.DT, SE.AC)) {
1714 Phi->replaceAllUsesWith(V);
1715 DeadInsts.push_back(Phi);
1718 << "INDVARS: Eliminated constant iv: " << *Phi << '\n');
1722 if (!SE.isSCEVable(Phi->getType()))
1725 PHINode *&OrigPhiRef = ExprToIVMap[SE.getSCEV(Phi)];
1727 OrigPhiRef = Phi;
1728 if (Phi->getType()->isIntegerTy() && TTI
1729 && TTI->isTruncateFree(Phi->getType(), Phis.back()->getType())) {
1730 // This phi can be freely truncated to the narrowest phi type. Map the
1733 SE.getTruncateExpr(SE.getSCEV(Phi), Phis.back()->getType());
1734 ExprToIVMap[TruncExpr] = Phi;
1739 // Replacing a pointer phi with an integer phi or vice-versa doesn't make
1741 if (OrigPhiRef->getType()->isPointerTy() != Phi->getType()->isPointerTy())
1748 cast<Instruction>(Phi->getIncomingValueForBlock(LatchBlock));
1750 // If this phi has the same width but is more canonical, replace the
1753 if (OrigPhiRef->getType() == Phi->getType()
1754 && !(ChainedPhis.count(Phi)
1756 && (ChainedPhis.count(Phi)
1757 || isExpandedAddRecExprPHI(Phi, IsomorphicInc, L))) {
1758 std::swap(OrigPhiRef, Phi);
1761 // Replacing the congruent phi is sufficient because acyclic redundancy
1763 // that a phi is congruent, it's often the head of an IV user cycle that
1764 // is isomorphic with the original phi. It's worth eagerly cleaning up the
1794 << "INDVARS: Eliminated congruent iv: " << *Phi << '\n');
1797 if (OrigPhiRef->getType() != Phi->getType()) {
1799 Builder.SetCurrentDebugLocation(Phi->getDebugLoc());
1800 NewIV = Builder.CreateTruncOrBitCast(OrigPhiRef, Phi->getType(), IVName);
1802 Phi->replaceAllUsesWith(NewIV);
1803 DeadInsts.push_back(Phi);