[all-commits] [llvm/llvm-project] bfbfbd: [LVI] Fix and re-enable at-use reasoning (PR60629)

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue Feb 14 06:56:58 PST 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bfbfbd8b65def121ba325c6c68aca09349d119fc
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-02-14 (Tue, 14 Feb 2023)

  Changed paths:
    M llvm/lib/Analysis/LazyValueInfo.cpp
    M llvm/test/Transforms/CorrelatedValuePropagation/cond-at-use.ll

  Log Message:
  [LVI] Fix and re-enable at-use reasoning (PR60629)

This fixes the handling of phi nodes in getConstantRangeAtUse()
and re-enables it, reverting the workaround from

For phi nodes, while we can make use of the edge condition for the
incoming value, we shouldn't look past the phi node to look for
further conditions, because we might be reasoning about values
from two different cycle iterations (which will have the same
SSA value).

To handle this more specifically we would have to detect cycles,
and there doesn't seem to be any motivating case for that at this

More information about the All-commits mailing list