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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 12 07:37:44 PDT 2024


fhahn wrote:

IIUC this should catch cases where the vector loop only executes a single iteration, right?

Ideally we would first remove the redundant compare-and-branch and induction recipes, and then rely on the VPlan-based cost model to consider this difference.

For the former, I just shared https://github.com/llvm/llvm-project/pull/108378 to do that. For the latter, I think we first need to change the cost of the exit condition to be computed by the VPlan-based cost model, instead of pre-computing it.

As you mentioned, this is leading to divergences between legacy and VPlan-based cost model. Ideally we would first migrate computing costs for all recipes to the VPlan-based cost model, ensuring the don't regress vs the legacy cost model, which is   still in the works.

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


More information about the llvm-commits mailing list