[all-commits] [llvm/llvm-project] 520b16: [ValueTracking] An or recurrence with a non-zero s...

Konstantin Bogdanov via All-commits all-commits at lists.llvm.org
Thu Sep 24 06:51:40 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 520b1687095eaf9dd410fb48ab622205e9fec044
      https://github.com/llvm/llvm-project/commit/520b1687095eaf9dd410fb48ab622205e9fec044
  Author: Konstantin Bogdanov <thevar1able at users.noreply.github.com>
  Date:   2026-09-24 (Thu, 24 Sep 2026)

  Changed paths:
    M llvm/lib/Analysis/ValueTracking.cpp
    M llvm/test/Analysis/ValueTracking/phi-known-nonzero.ll

  Log Message:
  -----------
  [ValueTracking] An or recurrence with a non-zero start value is non-zero (#226155)

Or-ing anything into a non-zero value keeps it non-zero, so
`isNonZeroRecurrence` can accept a simple `%iv = or %iv, %step`
recurrence with a non-zero constant start value, regardless of the step.

The first commit precommits the tests in `phi-known-nonzero.ll`.

This is split out of #222334. Together with a follow-up that stops
limiting the recursion depth for single-incoming (LCSSA) phis in
`isKnownNonZero`, it lets LoopIdiomRecognize (#222373) form `llvm.ctlz`
for the clz loop in ffmpeg's `sbc_calc_scalefactors`.



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