On Tue, Mar 6, 2018 at 4:44 PM, Martin Jambor <mjam...@suse.cz> wrote: > Hi Bin, > > On Tue, Mar 06 2018, Bin Cheng wrote: >> On Tue, Mar 6, 2018 at 2:28 PM, Richard Biener >>> >>> Do you think the situation happens often enough to make this worthwhile? >> There is one probably more useful case. Program may use global flags >> controlling >> how it does (heavy) computation. Such flags are only set couple of >> times in execution >> time. It would be useful if we can (IPA) propagate flags into computation >> heavy >> functions by versioning (if necessary). For example: >> >> int flag = 1; >> void foo () >> { >> //heavy computation wrto to flag >> } >> void main() >> { >> flag = 2; >> foo(); >> flag = 1; >> foo(); >> } >> > > So basically IPA-CP done on (not-addressable) static global variables. > Do you happen to know some real code which would benefit? I'd like to > experiment with it but would like to have a real thing to look at, as > opposed to artificial test cases. As Richi pointed out, I think this is not rare in spec. For this moment I only vaguely remember 544.nab_r for such issue, but I am sure there are other cases.
Thanks, bin > > Thanks, > > Martin > >