[all-commits] [llvm/llvm-project] b689f8: [SCEV] Limit ControlsOnlyExit logic to BinOps with...

Florian Hahn via All-commits all-commits at lists.llvm.org
Thu Apr 30 02:21:38 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b689f8b7c6e56ee0127f98d2e613b6aa2d7601b2
      https://github.com/llvm/llvm-project/commit/b689f8b7c6e56ee0127f98d2e613b6aa2d7601b2
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2026-04-30 (Thu, 30 Apr 2026)

  Changed paths:
    M llvm/lib/Analysis/ScalarEvolution.cpp
    A llvm/test/Analysis/ScalarEvolution/or-exit-cond.ll
    M llvm/test/Analysis/ScalarEvolution/trip-count-andor-selectform.ll
    M llvm/test/Analysis/ScalarEvolution/trip-count-andor.ll
    A llvm/test/Transforms/IndVarSimplify/or-exit-cond.ll

  Log Message:
  -----------
  [SCEV] Limit ControlsOnlyExit logic to BinOps with neutral elements. (#194831)

As far as I can tell, ControlsOnlyExit is used during reasoning to
assume
that we stay in the loop as long as the condition is true/false, and are
guaranteed to exit otherwise.

But unless I am missing something, a sub-condition of an AND/OR never
solely controls the exit, whether we exit always depends on both
conditions.

Pass false to ControlsOnlyExit, as otherwise we would incorrectly assume
that we must exit if either conditions is true, when we would only exit
if both are true.

For now, ControlsOnlyExit is only used for the neutral element case, it
may be worth removing this.

Alive2 proof of IndVars mis-compile: https://alive2.llvm.org/ce/z/kWs4hE

PR: https://github.com/llvm/llvm-project/pull/194831



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