[Mlir-commits] [mlir] [mlir] fix IntegerRangeAnalysis::staticallyNonNegative (PR #134003)
Jeff Niu
llvmlistbot at llvm.org
Wed Apr 2 16:53:26 PDT 2025
Mogball wrote:
> Ok, so, to clarify: is it required that the bottom state for an analysis be distinct from its unitialized state? Or are they necessarily identical so that an analysis _must_ derive a non-bottom value for any value it is invoked on?
Yes! Sparse data flow analysis treats uninitialized as the top state, i.e. `join(uninitialized, x) = x`. Therefore, it's a major problem if the bottom state is also uninitialized. E.g. `ContantValue` is a `std::optional<Attribute>` and uses `std::nullopt` to indicate uninitialized, and `Attribute()` to indicate "unknown value". The problem is that all states are set to uninitialized initially, so if for non-integer values, their pessimistic state is also uninitialized, they will never trigger an update. Also, it wouldn't make any sense.
https://github.com/llvm/llvm-project/pull/134003
More information about the Mlir-commits
mailing list