[llvm] [LV] Stop using the legacy cost model for udiv + friends (PR #152707)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 20 07:56:30 PDT 2025
david-arm wrote:
OK, I've reproduced the problem. It's a marathon, not a sprint it seems. :) So basically in order to remove the legacy cost model for the divides from vplan you need to also add the cost of the selects to vplan. Adding the cost of selects to vplan then triggers the legacy cost model assert because of completely unrelated reduction loops that require selects, except the selects in this case aren't modelled in the legacy cost model. That meant I had to add the cost of the selects for reductions back in to the legacy cost model. Doing so now triggers the assert again because the legacy cost model is adding the select cost twice for the divides! I'll have to hack something into `LoopVectorizationPlanner::selectVectorizationFactor` that only adds the cost of the select to the loop if it's used by something that isn't a divide.
https://github.com/llvm/llvm-project/pull/152707
More information about the llvm-commits
mailing list