[all-commits] [llvm/llvm-project] e99ca7: [LoopInterchange] Relax the legality check to acce...

Ryotaro Kasuga via All-commits all-commits at lists.llvm.org
Tue May 13 05:14:35 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e99ca74dc187a86671dd5b13c89fe2755465078a
      https://github.com/llvm/llvm-project/commit/e99ca74dc187a86671dd5b13c89fe2755465078a
  Author: Ryotaro Kasuga <kasuga.ryotaro at fujitsu.com>
  Date:   2025-05-13 (Tue, 13 May 2025)

  Changed paths:
    M llvm/lib/Transforms/Scalar/LoopInterchange.cpp
    M llvm/test/Transforms/LoopInterchange/inner-only-reductions.ll
    A llvm/test/Transforms/LoopInterchange/legality-check.ll

  Log Message:
  -----------
  [LoopInterchange] Relax the legality check to accept more patterns  (#139690)

When proving the legality of exchanging two loops, it doesn't need to
check the elements of the direction vectors associated with the loops
outside of the two target loops. Before this patch, the legality check
looked at all elements of a direction vector to calculate the
lexicographically order of the vector, which may reject some legal
exchanges. For example, if a direction vector is `[* < =]`, it is safe
to swap the last two loops because the corresponding subsequence of the
vector (`[< =]`) is lexicographically positive for both before and after
the exchange. However, the its order is unknown if we don't drop the
prefix since the first element is `*`. This patch improves the logic of
legality check to ignore such unrelated prefixes of direction vectors.



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