[all-commits] [llvm/llvm-project] 9517d7: [LoopVectorize] Improve Vectorization of Low Trip ...

Jack Styles via All-commits all-commits at lists.llvm.org
Tue Sep 22 00:09:35 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9517d7182766f9d16dda05a97464660e27ce91f3
      https://github.com/llvm/llvm-project/commit/9517d7182766f9d16dda05a97464660e27ce91f3
  Author: Jack Styles <jack.styles at arm.com>
  Date:   2026-09-22 (Tue, 22 Sep 2026)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    A llvm/test/Transforms/LoopVectorize/AArch64/low-trip-count-body-size-limit.ll
    A llvm/test/Transforms/LoopVectorize/AArch64/sve-low-trip-count-ic-3.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/sve-low-trip-count.ll
    A llvm/test/Transforms/LoopVectorize/RISCV/low-trip-count-body-size-limit.ll
    A llvm/test/Transforms/LoopVectorize/RISCV/small-trip-count-vf-plus-one.ll

  Log Message:
  -----------
  [LoopVectorize] Improve Vectorization of Low Trip Count Loops (#195823)

Currently, Small Loops with Trip Counts less than 16, and in situations
where the Trip Count (TC) is less than the Tail Folding Threshold are
harder to vectorize, its only possible where no epilogue will be
emitted. However, for loops with large bodies and small trip counts this
can be counterproductive to performance, often failing to vectorize
entirely. This is more prevalent with targets where
`getMinTripCountTailFoldingThreshold()` returns a value greater than 0.

To address this, the Small Loops where the TC == VF + 1 can now
vectorize, leading to a vectorized iteration (or loop if interleaving is
required) and a single scalar iteration. Later passes can then remove
the loop's entirely.

Testing an with OpenSource Fortran HPC Benchmark which includes multiple
loops with small trip counts, but large loop bodies, has shown
significant improvement to runtime after these changes.

Assisted-by: Claude Sonnet 4.6/Codex



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