Home | History | Annotate | Download | only in Analysis

Lines Matching defs:Phi

853 /// the PHI. If so, it may be reused by expanded expressions.
953 // Check that the chain of IV operands leading back to Phi can be hoisted.
972 /// Determine if this cyclic phi is in a form that would have been generated by
973 /// LSR. We don't care if the phi was actually expanded in this pass, as long
995 // If the PHI is a pointer, use a GEP, otherwise use an add or sub.
1018 /// \brief Hoist the addrec instruction chain rooted in the loop phi above the
1034 /// the available PHI SCEV by truncation and/or invertion of the step.
1036 const SCEVAddRecExpr *Phi,
1039 Type *PhiTy = SE.getEffectiveSCEVType(Phi->getType());
1046 Phi = dyn_cast<SCEVAddRecExpr>(SE.getTruncateOrNoop(Phi, RequestedTy));
1047 if (!Phi)
1051 if (Phi == Requested) {
1058 SE.getNegativeSCEV(Requested)) == Phi) {
1068 /// values, and return the PHI.
1078 // Reuse a previously-inserted PHI, if present.
1101 // We only handle truncation and inversion of phi recurrences for the
1110 // Check whether we can reuse this PHI node.
1130 // Try whether the phi can be translated into the requested form
1134 // Record the phi node. But don't stop we might find an exact match
1149 // Remember this PHI, even in post-inc mode.
1174 // StartV must be hoisted into L's preheader to dominate the new phi.
1179 // Expand code for the step value. Do this before creating the PHI so that PHI
1180 // reuse code doesn't see an incomplete PHI.
1191 // Create the PHI.
1199 // Create the step instructions and populate the PHI.
1209 // Create a step value and add it to the PHI.
1229 // Remember this PHI, even in post-inc mode.
1278 // In some cases, we decide to reuse an existing phi node but need to truncate
1305 // all cases. Consider a phi outide whose operand is replaced during
1434 // Create and insert the PHI node for the induction variable in the
1688 PHINode *Phi = dyn_cast<PHINode>(I); ++I) {
1689 Phis.push_back(Phi);
1706 PHINode *Phi = *PIter;
1710 if (Value *V = SimplifyInstruction(Phi, SE.DL, SE.TLI, SE.DT)) {
1711 Phi->replaceAllUsesWith(V);
1712 DeadInsts.push_back(Phi);
1715 << "INDVARS: Eliminated constant iv: " << *Phi << '\n');
1719 if (!SE.isSCEVable(Phi->getType()))
1722 PHINode *&OrigPhiRef = ExprToIVMap[SE.getSCEV(Phi)];
1724 OrigPhiRef = Phi;
1725 if (Phi->getType()->isIntegerTy() && TTI
1726 && TTI->isTruncateFree(Phi->getType(), Phis.back()->getType())) {
1727 // This phi can be freely truncated to the narrowest phi type. Map the
1730 SE.getTruncateExpr(SE.getSCEV(Phi), Phis.back()->getType());
1731 ExprToIVMap[TruncExpr] = Phi;
1736 // Replacing a pointer phi with an integer phi or vice-versa doesn't make
1738 if (OrigPhiRef->getType()->isPointerTy() != Phi->getType()->isPointerTy())
1745 cast<Instruction>(Phi->getIncomingValueForBlock(LatchBlock));
1747 // If this phi has the same width but is more canonical, replace the
1750 if (OrigPhiRef->getType() == Phi->getType()
1751 && !(ChainedPhis.count(Phi)
1753 && (ChainedPhis.count(Phi)
1754 || isExpandedAddRecExprPHI(Phi, IsomorphicInc, L))) {
1755 std::swap(OrigPhiRef, Phi);
1758 // Replacing the congruent phi is sufficient because acyclic redundancy
1760 // that a phi is congruent, it's often the head of an IV user cycle that
1761 // is isomorphic with the original phi. It's worth eagerly cleaning up the
1788 << "INDVARS: Eliminated congruent iv: " << *Phi << '\n');
1791 if (OrigPhiRef->getType() != Phi->getType()) {
1793 Builder.SetCurrentDebugLocation(Phi->getDebugLoc());
1794 NewIV = Builder.CreateTruncOrBitCast(OrigPhiRef, Phi->getType(), IVName);
1796 Phi->replaceAllUsesWith(NewIV);
1797 DeadInsts.push_back(Phi);