[all-commits] [llvm/llvm-project] 087df2: [LoopInterchange] Bail out if inner latch branch c...

Ryotaro Kasuga via All-commits all-commits at lists.llvm.org
Tue Jun 9 13:02:15 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 087df2c6a34542baf1b3acbf0088074c79769003
      https://github.com/llvm/llvm-project/commit/087df2c6a34542baf1b3acbf0088074c79769003
  Author: Ryotaro Kasuga <kasuga.ryotaro at fujitsu.com>
  Date:   2026-06-09 (Tue, 09 Jun 2026)

  Changed paths:
    M llvm/lib/Transforms/Scalar/LoopInterchange.cpp
    M llvm/test/Transforms/LoopInterchange/complex-inner-latch-condition.ll

  Log Message:
  -----------
  [LoopInterchange] Bail out if inner latch branch cond is not CmpInst (#202726)

The condition argument of the branch instruction in the inner loop latch
is checked during the legality check phase, and the loops are rejected
if the condition argument is in an unsupported form. Previously, this
check ran only when the condition was a `cmp` instruction, so it missed
cases where it was not, e.g., an `and` of two `i1` values.

This patch fixes the issue by simply bailing out if the condition
argument is not a `cmp` instruction. This may be too conservative, but
it is sound, and we can improve the analysis in the future if desired.

Fix #202220.



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