[llvm] [VPlan] Materialize VF and VFxUF using VPInstructions. (PR #152879)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 11 03:43:05 PDT 2025
================
@@ -3339,6 +3339,50 @@ void VPlanTransforms::materializeVectorTripCount(VPlan &Plan,
VectorTC.replaceAllUsesWith(Res);
}
+void VPlanTransforms::materializeVFAndVFxUF(VPlan &Plan, VPBasicBlock *VectorPH,
+ ElementCount VFEC) {
+ VPBuilder Builder(VectorPH, VectorPH->begin());
+ auto *TCTy = VPTypeAnalysis(Plan).inferScalarType(Plan.getTripCount());
+ VPValue &VF = Plan.getVF();
+ VPValue &VFxUF = Plan.getVFxUF();
+ if (VF.getNumUsers()) {
+ VPValue *RuntimeVF =
+ Plan.getOrAddLiveIn(ConstantInt::get(TCTy, VFEC.getKnownMinValue()));
+ if (VFEC.isScalable())
+ RuntimeVF = Builder.createNaryOp(
+ Instruction::Mul,
+ {Builder.createNaryOp(VPInstruction::VScale, {}, TCTy), RuntimeVF},
+ VPIRFlags::WrapFlagsTy(true, false));
----------------
fhahn wrote:
Yeah, added thanks
https://github.com/llvm/llvm-project/pull/152879
More information about the llvm-commits
mailing list