llvm
6f1e6e47 - [mlir][dataflow] Register dependency when const-prop fold returns non-operand (#194372)

Commit
33 days ago
[mlir][dataflow] Register dependency when const-prop fold returns non-operand (#194372) Fixes #137509. When `op->fold` returns a Value that is not one of `op`'s operands (e.g. `unrealized_conversion_cast`'s fold returns the inner cast's operand), `SparseConstantPropagation` read that value's lattice without subscribing to it -- so the op was not revisited when the lattice widened and its stale fold result was not updated. Fix by using `getLatticeElementFor(getProgramPointAfter(op), v)` to register the dependency. This matches a few places in `SparseAnalysis.cpp` where the same strategy is used. I'd love to use something even simpler than `unrealized_conversion_cast` operation in the test, but this is what i got when minimizing the reproduction from the original issue (#137509) and i wasn't able to find any operation that would work for this reproduction. Assisted-By: Claude Code
Author
Parents
Loading