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

Hari Limaye via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 18 06:31:46 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);
----------------
hazzlim wrote:

I've moved into optimizeForVFAndUF, splitting out the existing code and this new code into static functions as it seemed sensible to make the logic simpler/things easier to read, if you agree?

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


More information about the llvm-commits mailing list