There is a problem about how AliasSetTracker merging AliasSet’s when meet UnknownInst.
When adding new pointer it looks for existing AliasSet’s aliased with new pointer. And merging them together. It is ok for pointers: if %A mayalias %B and %B mayalias %C then %A mayalias %C.
But the same logic when adding callsite is wrong (findAliasSetForUnknownInst).
Callsite may be known to readonly access one pointer and change the content of other pointer.
Why to merge together two noalias pointers if they have some mod/ref relationships with common callsite?
If modrefinfo(%A, %call1) == REF and modrefinfo(%B, %call1) == MOD
it doesn’t mean %A may/must alias %B.
AliasSet’s for %A and %B must stay independent with corrected access lattice: aliasset(%A).Access |= RefAccess, aliasset(%B).Access |= ModAccess.
And I think new UnknownInst must be added to both AliasSet’s.
Or maybe UnknownInst’s must be collected in central part - AliasSetTracker, not AliasSet’s.
Am I right?