This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: expected_retval attribute proposal


 In message <200005101715.TAA01106@loewis.home.cs.tu-berlin.de>you write:
  > > Ideas?  If this turns out to be acceptable hack, I will implement the gcc
  > > part. (well and glibc part to if neccesary...)
  > 
  > I wouldn't stop you from implementing this idea, but I'd like to see
  > some use cases first. I.e. which of the glibc functions should have an
  > expected_retval, and which one? Analysing the gcc source code, or the
  > X11 source code (by means of grep), in how many cases are those
  > functions used, and in how many of those cases are the return values
  > relevant for branch prediction? (i.e. how many calls of those
  > functions appear in if-statements)
  > 
  > My feeling is that this could likely add a lot of machinery for little
  > gain.
That's my gut feeling too.

Most return values are non-negative and we can use that to help predict
some branches based on return values.   I doubt other reasonable to
implement heuristics for return values would be all that interesting.

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]