Path: utzoo!utgpu!attcan!uunet!tektronix!orca!tekecs!frip!andrew From: andrew@frip.gwd.tek.com (Andrew Klossner) Newsgroups: comp.arch Subject: Re: register save/restore Message-ID: <10600@tekecs.TEK.COM> Date: 10 Nov 88 20:02:09 GMT References: <3300037@m.cs.uiuc.edu> <5938@killer.DALLAS.TX.US> <1009@l.cc.purdue.edu> <9663@pur-ee.UUCP> Sender: andrew@tekecs.TEK.COM Organization: Tektronix, Wilsonville, Oregon Lines: 19 >>> Which is better - caller saves or callee saves? >>> Is this the right question? >> It is, if library subroutines are to be used. A compiler cannot change >> the procedure to be followed in this case. > This is actually a prime argument for caller saves. The reason is simple: > the compiler optimizations, if constrained to be performed without changing > the code of the called (library) routine, can only be applied in the caller. It is also a prime argument for callee saves. When the library routine is being compiled, the compiler optimizations are constrained to be performed without changing the code of the calling routine. The choice between optimizing routines near the frontier of the call graph and optimizing routines back toward the root of the graph should (IMHO) be made in favor of the frontier. -=- Andrew Klossner (uunet!tektronix!tekecs!frip!andrew) [UUCP] (andrew%frip.gwd.tek.com@relay.cs.net) [ARPA]