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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 17 07:39:15 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:

I don't think it would interfere with that, in general I assume it might make sense to apply this one for all potential VFs as narrower IVs might trip the balance eventually (at the moment, the cost of inductions isn't estimate correctly yet though).

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


More information about the llvm-commits mailing list