Home | History | Annotate | Download | only in Vectorize

Lines Matching refs:Phi

487   /// Returns True, if 'Phi' is the kind of reduction variable for type
489 bool AddReductionVar(PHINode *Phi, ReductionKind Kind);
493 /// Returns the induction kind of Phi. This function may return NoInduction
494 /// if the PHI is not an induction variable.
495 InductionKind isInductionVariable(PHINode *Phi);
804 PHINode *Phi = dyn_cast_or_null<PHINode>(Ptr);
805 if (Phi && Inductions.count(Phi)) {
806 InductionInfo II = Inductions[Phi];
823 Phi = dyn_cast<PHINode>(GpPtr);
824 if (Phi && Inductions.count(Phi)) {
836 InductionInfo II = Inductions[Phi];
1198 // value from the induction PHI node. If we don't have an induction variable
1217 // Use this IR builder to create the loop instructions (Phi, Br, Cmp)
1287 // The starting values of PHI nodes depend on the counter of the last
1308 assert(OrigPhi == OldInduction && "Unknown integer PHI");
1311 // We also know which PHI node holds it.
1316 // Convert the CountRoundDown variable to the PHI size.
1357 // The new PHI merges the original incoming value, in case of a bypass,
1363 // Fix the scalar body counter (PHI node).
1603 // Phi nodes. Phi nodes have cycles, so we need to vectorize them in two
1604 // stages. First, we create a new vector PHI node with no incoming edges.
1606 // PHI. Next, after all of the instructions in the block are complete we
1607 // add the new incoming edges to the PHI. At this point all of the
1609 // construct the PHI.
1623 // a vector form. We are almost done. Now, we need to fix the PHI nodes
1624 // that we vectorized. The PHI nodes are currently empty because we did
1625 // not want to introduce cycles. Notice that the remaining PHI nodes
1634 assert(RdxPhi && "Unable to recover vectorized PHI");
1662 // Fix the vector-loop phi.
1692 PHINode *NewPhi = Builder.CreatePHI(VecTy, 2, "rdx.vec.exit.phi");
1740 // PHI nodes in the exit blocks.
1748 assert(LCSSAPhi->getNumIncomingValues() < 3 && "Invalid LCSSA PHI");
1750 // We found our reduction value exit-PHI. Update it with the
1757 }// end of the LCSSA phi scan.
1770 // The Loop exit block may have single value PHI nodes where the incoming
1845 case Instruction::PHI:{
1852 Entry[part] = PHINode::Create(VecTy, 2, "vec.phi",
1859 // Check for PHI nodes that are lowered to vector selects.
1892 assert(P == OldInduction && "Unexpected PHI");
1966 }// End of PHI.
2257 if (PHINode *Phi = dyn_cast<PHINode>(it)) {
2259 if (Phi->getNumIncomingValues() != 2) {
2260 DEBUG(dbgs() << "LV: Found an invalid PHI.\n");
2264 // Check that this PHI type is allowed.
2265 if (!Phi->getType()->isIntegerTy() &&
2266 !Phi->getType()->isFloatingPointTy() &&
2267 !Phi->getType()->isPointerTy()) {
2268 DEBUG(dbgs() << "LV: Found an non-int non-pointer PHI.\n");
2279 Value *StartValue = Phi->getIncomingValueForBlock(PreHeader);
2281 InductionKind IK = isInductionVariable(Phi);
2287 DEBUG(dbgs() << "LV: Found too many inductions."<< *Phi <<"\n");
2290 Induction = Phi;
2294 Inductions[Phi] = InductionInfo(StartValue, IK);
2298 if (AddReductionVar(Phi, RK_IntegerAdd)) {
2299 DEBUG(dbgs() << "LV: Found an ADD reduction PHI."<< *Phi <<"\n");
2302 if (AddReductionVar(Phi, RK_IntegerMult)) {
2303 DEBUG(dbgs() << "LV: Found a MUL reduction PHI."<< *Phi <<"\n");
2306 if (AddReductionVar(Phi, RK_IntegerOr)) {
2307 DEBUG(dbgs() << "LV: Found an OR reduction PHI."<< *Phi <<"\n");
2310 if (AddReductionVar(Phi, RK_IntegerAnd)) {
2311 DEBUG(dbgs() << "LV: Found an AND reduction PHI."<< *Phi <<"\n");
2314 if (AddReductionVar(Phi, RK_IntegerXor)) {
2315 DEBUG(dbgs() << "LV: Found a XOR reduction PHI."<< *Phi <<"\n");
2318 if (AddReductionVar(Phi, RK_FloatMult)) {
2319 DEBUG(dbgs() << "LV: Found an FMult reduction PHI."<< *Phi <<"\n");
2322 if (AddReductionVar(Phi, RK_FloatAdd)) {
2323 DEBUG(dbgs() << "LV: Found an FAdd reduction PHI."<< *Phi <<"\n");
2327 DEBUG(dbgs() << "LV: Found an unidentified PHI."<< *Phi <<"\n");
2329 }// end of PHI handling
2392 // Stop when reaching PHI nodes.
2710 bool LoopVectorizationLegality::AddReductionVar(PHINode *Phi,
2712 if (Phi->getNumIncomingValues() != 2)
2716 if (Phi->getParent() != TheLoop->getHeader())
2721 Value *RdxStart = Phi->getIncomingValueForBlock(TheLoop->getLoopPreheader());
2726 // which ends in the phi node).
2731 // Iter is our iterator. We start with the PHI node and scan for all of the
2734 // out-of-block user. The cycle must end with the original PHI.
2735 Instruction *Iter = Phi;
2744 // Did we reach the initial PHI node already ?
2757 // We already know that the PHI is a user.
2758 if (U == Phi) {
2772 // We allow in-loop PHINodes which are not the original reduction PHI
2773 // node. If this PHI is the only user of Iter (happens in IF w/ no ELSE
2774 // structure) then don't skip this PHI.
2803 // phi node and we only have a single instruction with out-of-loop
2811 Reductions[Phi] = RD;
2828 case Instruction::PHI:
2854 LoopVectorizationLegality::isInductionVariable(PHINode *Phi) {
2855 Type *PhiTy = Phi->getType();
2860 // Check that the PHI is consecutive.
2861 const SCEV *PhiScev = SE->getSCEV(Phi);
2864 DEBUG(dbgs() << "LV: PHI is not a poly recurrence.\n");
2883 assert(PhiTy->isPointerTy() && "The PHI must be a pointer");
3037 // Examine PHI nodes that are reduction variables.
3314 case Instruction::PHI: