Files
llvm-project/mlir/lib/Analysis/DataFlow/IntegerRangeAnalysis.cpp
Krzysztof Drewniak 25ad2ee86d [mlir][IntegerRangeAnalysis] Don't unsoundly update constant lattice (#193546)
Fixes #119045

Integer range analysis tried to be clever and update the constant value
lattice when it inferred something to be a constant. However, this
caused correctness issues, because the integer range analysis can go
from "constant" to "not a constant" once more control edges are
analyzed, but the constant value lattice is used by dead code
elimination to skip branches ... including those that might prove that
the conditional for the branch isn't actually a constant.

Unlike in my ancient attempt at a fix, the solution is just to stop
trying to be clever.

This change required loading the constant propagation analysis in
-arith-unsigned-when-equivalent to keep tests working (which should have
been loaded anyway to make the dead code analysis work correctly).

No AI tools used.
2026-04-23 14:28:58 +02:00

9.8 KiB