Home | History | Annotate | Download | only in Analysis

Lines Matching refs:Phi

824 /// the PHI. If so, it may be reused by expanded expressions.
926 // Check that the chain of IV operands leading back to Phi can be hoisted.
944 /// Determine if this cyclic phi is in a form that would have been generated by
945 /// LSR. We don't care if the phi was actually expanded in this pass, as long
967 // If the PHI is a pointer, use a GEP, otherwise use an add or sub.
990 /// \brief Hoist the addrec instruction chain rooted in the loop phi above the
1006 /// the available PHI SCEV by truncation and/or inversion of the step.
1008 const SCEVAddRecExpr *Phi,
1011 Type *PhiTy = SE.getEffectiveSCEVType(Phi->getType());
1018 Phi = dyn_cast<SCEVAddRecExpr>(SE.getTruncateOrNoop(Phi, RequestedTy));
1019 if (!Phi)
1023 if (Phi == Requested) {
1030 SE.getNegativeSCEV(Requested)) == Phi) {
1068 /// values, and return the PHI.
1078 // Reuse a previously-inserted PHI, if present.
1102 // We only handle truncation and inversion of phi recurrences for the
1111 // Check whether we can reuse this PHI node.
1131 // Try whether the phi can be translated into the requested form
1135 // Record the phi node. But don't stop we might find an exact match
1150 // Remember this PHI, even in post-inc mode.
1175 // StartV must be hoisted into L's preheader to dominate the new phi.
1180 // Expand code for the step value. Do this before creating the PHI so that PHI
1181 // reuse code doesn't see an incomplete PHI.
1198 // Create the PHI.
1206 // Create the step instructions and populate the PHI.
1216 // Create a step value and add it to the PHI.
1237 // Remember this PHI, even in post-inc mode.
1285 // In some cases, we decide to reuse an existing phi node but need to truncate
1312 // all cases. Consider a phi outide whose operand is replaced during
1437 // Create and insert the PHI node for the induction variable in the
1714 for (PHINode *Phi : Phis) {
1728 if (Value *V = SimplifyPHINode(Phi)) {
1729 if (V->getType() != Phi->getType())
1731 Phi->replaceAllUsesWith(V);
1732 DeadInsts.emplace_back(Phi);
1735 << "INDVARS: Eliminated constant iv: " << *Phi << '\n');
1739 if (!SE.isSCEVable(Phi->getType()))
1742 PHINode *&OrigPhiRef = ExprToIVMap[SE.getSCEV(Phi)];
1744 OrigPhiRef = Phi;
1745 if (Phi->getType()->isIntegerTy() && TTI
1746 && TTI->isTruncateFree(Phi->getType(), Phis.back()->getType())) {
1747 // This phi can be freely truncated to the narrowest phi type. Map the
1750 SE.getTruncateExpr(SE.getSCEV(Phi), Phis.back()->getType());
1751 ExprToIVMap[TruncExpr] = Phi;
1756 // Replacing a pointer phi with an integer phi or vice-versa doesn't make
1758 if (OrigPhiRef->getType()->isPointerTy() != Phi->getType()->isPointerTy())
1765 cast<Instruction>(Phi->getIncomingValueForBlock(LatchBlock));
1767 // If this phi has the same width but is more canonical, replace the
1770 if (OrigPhiRef->getType() == Phi->getType()
1771 && !(ChainedPhis.count(Phi)
1773 && (ChainedPhis.count(Phi)
1774 || isExpandedAddRecExprPHI(Phi, IsomorphicInc, L))) {
1775 std::swap(OrigPhiRef, Phi);
1778 // Replacing the congruent phi is sufficient because acyclic redundancy
1780 // that a phi is congruent, it's often the head of an IV user cycle that
1781 // is isomorphic with the original phi. It's worth eagerly cleaning up the
1811 << "INDVARS: Eliminated congruent iv: " << *Phi << '\n');
1814 if (OrigPhiRef->getType() != Phi->getType()) {
1816 Builder.SetCurrentDebugLocation(Phi->getDebugLoc());
1817 NewIV = Builder.CreateTruncOrBitCast(OrigPhiRef, Phi->getType(), IVName);
1819 Phi->replaceAllUsesWith(NewIV);
1820 DeadInsts.emplace_back(Phi);