On 12/13/2017 07:39 AM, Jakub Jelinek wrote: > Hi! > > While the PRED_NEGATIVE_RETURN heuristics generally works quite well, for > qsort comparison functions and similar, including the planned C++ > spaceship operator <=> where typically negative and positive are > approximately even it doesn't work that well. This patch is an attempt > to at least detect some of these cases. It won't catch functions where > also other values are returned (e.g. a - b or similar), but then it would be > even harder to make a distinction. > > Bootstrapped/regtested on {x86_64,i686,powerpc64le}-linux, regtest on > powerpc64-linux pending. Honza, if it doesn't look completely bogus to you, > could you give it a spin on SPEC (which I don't have easy access to)? Note you can have access to SPEC. Red Hat is appropriately licensed. Contact Vlad to get suitable bits.
> > 2017-12-13 Jakub Jelinek <ja...@redhat.com> > > PR middle-end/81914 > * predict.c (zero_one_minusone): New function. > (apply_return_prediction): Avoid return prediction for functions > returning only -1, 0 and 1 values, unless they only return -1 and 0 > or 0 and 1. Seems reasonable to me. You call on how long to wait for Honza. Jeff