Currently, for sparse analyses, we always store a Optional<ValueT> in each lattice element. When it's None, we consider the lattice element as uninitialized.
However:
- Not all lattices have an uninitialized state. For example, Executable and PredecessorState have default values so they are always initialized.
- In dense analyses, we don't have the concept of an uninitialized state.
Given these inconsistencies, this patch removes Lattice::isUninitialized(). Individual analysis states are now default-constructed. If the default state of an analysis can be considered as "uninitialized" then this analysis should implement the following logic:
- Special join rule: join(uninitialized, any) == any.
- Special bail out logic: if any of the input states is uninitialized, exit the transfer function early.
Depends On D132086
Can you replace Optional<Impl> with just an Attribute and a flag? Or at least do Optional<Attribute> since the dialect value doesn't place a role in the analysis very much.