Home | History | Annotate | Download | only in Vectorize

Lines Matching defs:Phi

305   /// \brief The Loop exit block may have single value PHI nodes where the
751 /// Returns True, if 'Phi' is the kind of reduction variable for type
753 bool AddReductionVar(PHINode *Phi, ReductionKind Kind);
765 /// Returns the induction kind of Phi. This function may return NoInduction
766 /// if the PHI is not an induction variable.
767 InductionKind isInductionVariable(PHINode *Phi);
1492 PHINode *Phi = dyn_cast_or_null<PHINode>(Ptr);
1493 if (Phi && Inductions.count(Phi)) {
1494 InductionInfo II = Inductions[Phi];
1509 Phi = dyn_cast<PHINode>(GpPtr);
1510 if (Phi && Inductions.count(Phi)) {
1522 InductionInfo II = Inductions[Phi];
1547 // %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
2050 // The exit count might have the type of i64 while the phi is i32. This can
2085 // value from the induction PHI node. If we don't have an induction variable
2133 // Use this IR builder to create the loop instructions (Phi, Br, Cmp)
2250 // The starting values of PHI nodes depend on the counter of the last
2274 // Create phi nodes to merge from the backedge-taken check block.
2301 // The new PHI merges the original incoming value, in case of a bypass,
2311 // We also know which PHI node holds it.
2325 // Convert the CountRoundDown variable to the PHI size.
2352 // The new PHI merges the original incoming value, in case of a bypass,
2362 // Fix the scalar body counter (PHI node).
2365 // The old induction's phi node in the scalar body needs the truncated
2609 // Phi nodes. Phi nodes have cycles, so we need to vectorize them in two
2610 // stages. First, we create a new vector PHI node with no incoming edges.
2612 // PHI. Next, after all of the instructions in the block are complete we
2613 // add the new incoming edges to the PHI. At this point all of the
2615 // construct the PHI.
2629 // a vector form. We are almost done. Now, we need to fix the PHI nodes
2630 // that we vectorized. The PHI nodes are currently empty because we did
2631 // not want to introduce cycles. Notice that the remaining PHI nodes
2640 assert(RdxPhi && "Unable to recover vectorized PHI");
2694 // Fix the vector-loop phi.
2726 PHINode *NewPhi = Builder.CreatePHI(VecTy, 2, "rdx.vec.exit.phi");
2786 // Create a phi node that merges control-flow from the backedge-taken check
2796 // PHI nodes in the exit blocks.
2804 assert(LCSSAPhi->getNumIncomingValues() < 3 && "Invalid LCSSA PHI");
2806 // We found our reduction value exit-PHI. Update it with the
2813 }// end of the LCSSA phi scan.
2912 Entry[part] = PHINode::Create(VecTy, 2, "vec.phi",
2920 // Check for PHI nodes that are lowered to vector selects.
2942 // 'select' for the first PHI operand.
3074 case Instruction::PHI:{
3078 }// End of PHI.
3292 /// \brief Check whether it is safe to if-convert this phi node.
3294 /// Phi nodes with constant expressions that can trap are not safe to if
3298 PHINode *Phi = dyn_cast<PHINode>(I);
3299 if (!Phi)
3301 for (unsigned p = 0, e = Phi->getNumIncomingValues(); p != e; ++p)
3302 if (Constant *C = dyn_cast<Constant>(Phi
3498 if (PHINode *Phi = dyn_cast<PHINode>(it)) {
3499 Type *PhiTy = Phi->getType();
3500 // Check that this PHI type is allowed.
3506 DEBUG(dbgs() << "LV: Found an non-int non-pointer PHI.\n");
3524 if (Phi->getNumIncomingValues() != 2) {
3527 DEBUG(dbgs() << "LV: Found an invalid PHI.\n");
3532 Value *StartValue = Phi->getIncomingValueForBlock(PreHeader);
3534 InductionKind IK = isInductionVariable(Phi);
3545 // Use the phi node with the widest type as induction. Use the last
3549 Induction = Phi;
3553 Inductions[Phi] = InductionInfo(StartValue, IK);
3566 if (AddReductionVar(Phi, RK_IntegerAdd)) {
3567 DEBUG(dbgs() << "LV: Found an ADD reduction PHI."<< *Phi <<"\n");
3570 if (AddReductionVar(Phi, RK_IntegerMult)) {
3571 DEBUG(dbgs() << "LV: Found a MUL reduction PHI."<< *Phi <<"\n");
3574 if (AddReductionVar(Phi, RK_IntegerOr)) {
3575 DEBUG(dbgs() << "LV: Found an OR reduction PHI."<< *Phi <<"\n");
3578 if (AddReductionVar(Phi, RK_IntegerAnd)) {
3579 DEBUG(dbgs() << "LV: Found an AND reduction PHI."<< *Phi <<"\n");
3582 if (AddReductionVar(Phi, RK_IntegerXor)) {
3583 DEBUG(dbgs() << "LV: Found a XOR reduction PHI."<< *Phi <<"\n");
3586 if (AddReductionVar(Phi, RK_IntegerMinMax)) {
3587 DEBUG(dbgs() << "LV: Found a MINMAX reduction PHI."<< *Phi <<"\n");
3590 if (AddReductionVar(Phi, RK_FloatMult)) {
3591 DEBUG(dbgs() << "LV: Found an FMult reduction PHI."<< *Phi <<"\n");
3594 if (AddReductionVar(Phi, RK_FloatAdd)) {
3595 DEBUG(dbgs() << "LV: Found an FAdd reduction PHI."<< *Phi <<"\n");
3598 if (AddReductionVar(Phi, RK_FloatMinMax)) {
3599 DEBUG(dbgs() << "LV: Found an float MINMAX reduction PHI."<< *Phi <<
3605 DEBUG(dbgs() << "LV: Found an unidentified PHI."<< *Phi <<"\n");
3607 }// end of PHI handling
3834 // Stop when reaching PHI nodes.
4153 /// be a cycle through a phi node (that is, we check that "x" and "y" is not
4154 /// the same variable: a header phi can only be an induction or a reduction, a
4795 bool LoopVectorizationLegality::AddReductionVar(PHINode *Phi,
4797 if (Phi->getNumIncomingValues() != 2)
4801 if (Phi->getParent() != TheLoop->getHeader())
4806 Value *RdxStart = Phi->getIncomingValueForBlock(TheLoop->getLoopPreheader());
4811 // which ends in the phi node).
4816 // We start with the PHI node and scan for all of the users of this
4819 // must include the original PHI.
4830 Worklist.push_back(Phi);
4831 VisitedInsts.insert(Phi);
4838 // - PHI:
4839 // - All uses of the PHI must be the reduction (safe).
4845 // * An instruction type other than PHI or the reduction operation.
4846 // * A PHI in the header other than the initial PHI.
4859 // A header PHI use other than the original PHI.
4860 if (Cur != Phi && IsAPhi && Cur->getParent() == Phi->getParent())
4880 // All inputs to a PHI node must be a reduction value.
4881 if(IsAPhi && Cur != Phi && !areAllUsesIn(Cur, VisitedInsts))
4894 // Process users of current instruction. Push non-PHI nodes after PHI nodes
4895 // onto the stack. This way we are going to have seen all inputs to PHI
4905 // Exit if you find multiple outside users or if the header phi node is
4909 if (ExitInstruction != nullptr || Cur == Phi)
4913 // before we feed back to the reduction phi. Otherwise, we loose VF-1
4915 if (std::find(Phi->op_begin(), Phi->op_end(), Cur) == Phi->op_end())
4923 // value must only be used once, except by phi nodes and min/max
4939 if (UI == Phi)
4955 // We found a reduction var if we have reached the original phi node and we
4964 Reductions[Phi] = RD;
5032 case Instruction::PHI:
5063 LoopVectorizationLegality::isInductionVariable(PHINode *Phi) {
5064 Type *PhiTy = Phi->getType();
5069 // Check that the PHI is consecutive.
5070 const SCEV *PhiScev = SE->getSCEV(Phi);
5073 DEBUG(dbgs() << "LV: PHI
5092 assert(PhiTy->isPointerTy() && "The PHI must be a pointer");
5287 // Examine PHI nodes that are reduction variables.
5677 case Instruction::PHI: