New attribute "infrequent"?

Geert Bosch bosch@gnat.com
Mon Aug 27 09:14:00 GMT 2001


On Mon, 27 Aug 2001, Jan Hubicka wrote:
  We can add an attribute (probably called "infrequent") to the functions.  Such
  attribute exhibits a hint, that given function is definitly outside performance
  cirtical code, so gcc can:
  
  1) optimize it for size
  2) use for branch prediction purposes
  3) propagate the information to other functions allways calling infrequent
  4) once procedure splitting is implemented (if at all), it can move whole
     function to infrequently executed section.

I would think we get most of the benefit already by recognizing "noreturn" 
functions and all calls leading to those. Marking functions "infrequent" is 
a much more fuzzy notion, and has therefore the risk of being counter-productive,
especially as functions may be used in an entirely different way by different
programs. The distributed cost of maintaining such attributes all over the place
seems to be way higher than the benefit of such an optimization.

  -Geert



More information about the Gcc mailing list