[all-commits] [llvm/llvm-project] b75530: [LoopInterchange] Consider forward/backward depend...

Ryotaro Kasuga via All-commits all-commits at lists.llvm.org
Fri Jul 25 06:37:42 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b75530ff034a131da8ca1f05a00f3655c13839ff
      https://github.com/llvm/llvm-project/commit/b75530ff034a131da8ca1f05a00f3655c13839ff
  Author: Ryotaro Kasuga <kasuga.ryotaro at fujitsu.com>
  Date:   2025-07-25 (Fri, 25 Jul 2025)

  Changed paths:
    M llvm/lib/Transforms/Scalar/LoopInterchange.cpp
    M llvm/test/Transforms/LoopInterchange/profitability-vectorization-heuristic.ll

  Log Message:
  -----------
  [LoopInterchange] Consider forward/backward dependency in vectorize heuristic (#133672)

The vectorization heuristic of LoopInterchange attempts to move a
vectorizable loop to the innermost position. Before this patch, a loop
was deemed vectorizable if there are no loop-carried dependencies
induced by the loop.
This patch extends the vectorization heuristic by introducing the
concept of forward and backward dependencies, inspired by
LoopAccessAnalysis. Specifically, an additional element is appended to
each direction vector to indicate whether it represents a forward
dependency (`<`) or not (`*`). Among these, only the forward
dependencies (i.e., those whose last element is `<`) affect the
vectorization heuristic. Accordingly, the check is conservative, and
dependencies are considered forward only when this can be proven.
Currently, we only support perfectly nested loops whose body consists of
a single basic block. For other cases, dependencies are pessimistically
treated as non-forward.



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