To make usage easier (compared to the many reachability related AAs),
this patch introduces a helper API, AA::isPotentiallyReachable, which
performs all the necessary steps. It also does the "backwards"
reachability (see D106720) as that simplifies the AA a lot (backwards
queries were somewhat different from the other query resolvers), and
ensures we use cached values in every stage.
To test inter-procedural reachability in a reasonable way this patch
includes an extension to AAPointerInfo::forallInterferingWrites.
Basically, we can exclude writes if they cannot reach a load "during the
lifetime" of the allocation. That is, we need to go up the call graph to
determine reachability until we can determine the allocation would be
dead in the caller. This leads to new constant propagations (through
memory) in value-simplify-pointer-info-gpu.ll.
Note: The new code contains plenty debug output to determine how
reachability queries are resolved.
Parts extracted from D110078.
I don't think this would work for recursive functions when doing backwards reachability.
the next instruction might contain a call that will reach ToI