[llvm] [VPlan] Introduce ExitPhi VPInstruction, use to create phi for FOR. (PR #94760)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 9 13:59:26 PDT 2024
================
@@ -593,13 +601,35 @@ Value *VPInstruction::generatePerPart(VPTransformState &State, unsigned Part) {
Value *Addend = State.get(getOperand(1), Part, /* IsScalar */ true);
return Builder.CreatePtrAdd(Ptr, Addend, Name);
}
+ case VPInstruction::ResumePhi: {
+ if (Part != 0)
+ return State.get(this, 0, /*IsScalar*/ true);
+ Value *IncomingFromVPlanPred =
+ State.get(getOperand(0), Part, /* IsScalar */ true);
+ Value *IncomingFromOtherPreds =
+ State.get(getOperand(1), Part, /* IsScalar */ true);
----------------
ayalz wrote:
Is it conceivable for the scalar preheader to have a single predecessor, namely, VPlanPred/middle-block? I.e., when trip count is known to be larger that VFxUF and no (other) runtime checks are needed to bypass the vector loop?
https://github.com/llvm/llvm-project/pull/94760
More information about the llvm-commits
mailing list