[all-commits] [llvm/llvm-project] 6ad85f: [Polly] Do not assume loops to be bounded if latch...

Timur Baidusenov via All-commits all-commits at lists.llvm.org
Fri Sep 25 07:51:33 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6ad85f11c5151f18a3686322e37f8e64a48be327
      https://github.com/llvm/llvm-project/commit/6ad85f11c5151f18a3686322e37f8e64a48be327
  Author: Timur Baidusenov <timurbaidusenov at gmail.com>
  Date:   2026-09-25 (Fri, 25 Sep 2026)

  Changed paths:
    M polly/lib/Analysis/ScopBuilder.cpp
    M polly/test/ScopInfo/issue190128.ll
    M polly/test/ScopInfo/simple_loop_unsigned.ll
    A polly/test/ScopInfo/zext-loop-bound-unbounded.ll

  Log Message:
  -----------
  [Polly] Do not assume loops to be bounded if latch conditions are invalid (#226202)

If a loop with an `<nsw>` induction variable appears to be unbounded for
some parameter values, `addLoopBoundsToHeaderDomain` removes them from
its domain without a runtime check, but the loop may only appear
unbounded because its latch condition is modeled incorrectly for these
values, e.g. `(zext i16 %n to i64)` is modeled as `n` under the
assumption `n >= 0`. Removing them also dropped that assumption, so for
`n < 0` the loop was not executed at all instead of running `65536 + n`
iterations. Exclude the parameter values for which the latch conditions
are invalid by a runtime check instead.

Fixes #192616 and #192618.

Assisted-by: Claude (Anthropic)



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