[all-commits] [llvm/llvm-project] 2b6bdb: [LV] Bundle (partial) reductions with a mul of a c...

Sam Tebbs via All-commits all-commits at lists.llvm.org
Thu Oct 9 02:32:29 PDT 2025


  Branch: refs/heads/users/SamTebbs33/bundle-constant-mul
  Home:   https://github.com/llvm/llvm-project
  Commit: 2b6bdb685c8e54555cda65dc1ddd9f07ba8ef9a0
      https://github.com/llvm/llvm-project/commit/2b6bdb685c8e54555cda65dc1ddd9f07ba8ef9a0
  Author: Samuel Tebbs <samuel.tebbs at arm.com>
  Date:   2025-10-08 (Wed, 08 Oct 2025)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
    M llvm/test/Transforms/LoopVectorize/vplan-printing-reductions.ll

  Log Message:
  -----------
  [LV] Bundle (partial) reductions with a mul of a constant

A reduction (including partial reductions) with a multiply of a constant value can be bundled
by first converting it from `reduce.add(mul(ext, const))` to
`reduce.add(mul(ext, ext(const)))` as long as it is safe to extend the
constant.

This PR adds such bundling by first truncating the constant to the
source type of the other extend, then extending it to the destination
type of the extend. The first truncate is necessary so that the types of
each extend's operand are then the same, and the call to
canConstantBeExtended proves that the extend following a truncate is
safe to do. The truncate is removed by optimisations.



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