[all-commits] [llvm/llvm-project] d20024: [LV] Only create partial reductions when profitable.

Sander de Smalen via All-commits all-commits at lists.llvm.org
Wed Mar 4 00:47:30 PST 2026


  Branch: refs/heads/users/sdesmalen-arm/lv-create-partial-reductions-only-when-profitable
  Home:   https://github.com/llvm/llvm-project
  Commit: d200246f435e159af997f96d0f46d30e7510325b
      https://github.com/llvm/llvm-project/commit/d200246f435e159af997f96d0f46d30e7510325b
  Author: Sander de Smalen <sander.desmalen at arm.com>
  Date:   2026-03-03 (Tue, 03 Mar 2026)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
    M llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-chained.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/vector-reverse.ll

  Log Message:
  -----------
  [LV] Only create partial reductions when profitable.

We want the LV cost-model to make the best possible decision of
VF and whether or not to use partial reductions.  At the moment,
when the LV can use partial reductions for a given VF range, it
assumes those are always preferred. After transforming the plan to
use partial reductions, it then chooses the most profitable VF. It
is possible for a different VF to have been more profitable, if it
wouldn't have chosen to use partial reductions.

This PR changes that, to first decide whether partial reductions
are more profitable for a given chain. If not, then it won't do
the transform.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list