On Fri, Oct 25, 2019 at 1:09 AM Gary Oblock <gobl...@marvell.com> wrote: > > I'm wondering if the code in tree-ssa-structalias.c can be invoked in > a whole program mode? There are some comments in there about > it not playing well with WHOPR and WPA (not that I intend to use > that way.) Ironically, in the literature on points-to analysis this > algorithm > was only originally intended to be run on whole programs.
There's separate entries into the analysis for whole-program (ipa_pta_execute) and single-function operation (compute_may_aliases) using the same underlying constraint solver (but obviously slightly different constraint setup). Since constraint generation needs access to function bodies the whole-program PTA analysis is currently not performed at WPA stage but for individual LTRANS units, so it doesn't get to see the whole program after all (unless the whole program fits into a single LTRANS unit or you use -flto-partition={one,none}). > By the way, how are the users of the points-to sets actually supposed > to access and use them? Generally points-to solutions are queried from the may-alias oracle but there's the pt_solution_* API in tree-ssa-alias.h where the actual solutions have to be get via SSA_NAME_PTR_INFO (so points-to solutions are only available for SSA name pointers, not memory). Richard. > > Thanks, > > Gary >