[llvm] [LV] Optimize VPWidenIntOrFpInductionRecipe for known TC (PR #118828)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 17 07:03:43 PST 2024


================
@@ -7657,6 +7657,9 @@ DenseMap<const SCEV *, Value *> LoopVectorizationPlanner::executePlan(
                               OrigLoop->getHeader()->getContext());
   VPlanTransforms::optimizeForVFAndUF(BestVPlan, BestVF, BestUF, PSE);
 
+  auto TC = PSE.getSE()->getSmallConstantTripCount(OrigLoop);
+  VPlanTransforms::optimizeForTCAndVF(BestVPlan, TC, BestVF);
----------------
fhahn wrote:

Can we instead use BestVPlan.getTripCount() and move this in optimizeForVFAndUF, as this also optimizes the plan for a given UF/VF?

https://github.com/llvm/llvm-project/pull/118828


More information about the llvm-commits mailing list