Code enlargement

Richard Henderson rth@redhat.com
Sat Sep 1 10:21:00 GMT 2001


On Sat, Sep 01, 2001 at 02:18:17PM +0200, Frank Klemm wrote:
> 	- avoid this trick with '-Os', may be also with '-O2', because speed
> 	  increase is very little, zero or below zero. Brnach prediction
> 	  seems to work very well.

Certainly I agree that different heuristics should be used with -Os,
but it's not so much "avoid this trick" as "reorganize to minimize
branches rather than create a non-branching fast-path".

For -Os we should consider the size of the branch to be the weight
of the edge, and find a layout with minimal total cost.  The existing
branch-shortening infrastructure can be used to find sizes of 
instructions.

Care to write some code to implement this?



r~



More information about the Gcc mailing list