[llvm] [LV] Ignore some costs when loop gets fully unrolled (PR #106699)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 13 13:10:19 PST 2024


https://github.com/fhahn commented:

> As far as I understand, `optimizeForVFAndUF` runs after the cost model is calculated and taken into account to choose the best vectorisation factor:
> 
> ```
>   VPlanTransforms::optimizeForVFAndUF(BestVPlan, BestVF, BestUF, PSE);
> ```
> 
> Is `optimizeForVFAndUF` eventually going to be run for all VFs before the cost model decision? If so, now VPlan implies all possible VF. So, will it generate new VPLans if `optimizeForVFAndUF` changes something?

Eventually yes, eventually there should be no need to special case this. VPlans are valid for a range, that could be split. I guess for now doing it as workaround in `precomputeCosts` seems OK, even though it is not really intended for that (ideally we only remove stuff from there at this point). Could you add a comment to make sure this is not seen as encouragement to add more code that's not directly related to the transition to the VPlan-based cost model?


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


More information about the llvm-commits mailing list