Path: utzoo!attcan!uunet!cs.utexas.edu!rice!titan.rice.edu!preston From: preston@titan.rice.edu (Preston Briggs) Newsgroups: comp.arch Subject: Re: Inlining subroutines at link time Message-ID: <9595@brazos.Rice.edu> Date: 3 Jul 90 20:24:11 GMT References: <1990Jul3.194348.21178@msuinfo.cl.msu.edu> Sender: root@rice.edu Organization: Rice University, Houston Lines: 24 In article <1990Jul3.194348.21178@msuinfo.cl.msu.edu> riordanmr@clvax1.cl.msu.edu (Mark Riordan) writes: >I just came across a CDC NOS/VE manual describing a facility to >inline FORTRAN routines after compilation (essentially during linking). >I no longer have access to a NOS/VE system, so I don't know how well >this works, but it seems like a fairly unique feature to me. Have >you folks ever heard of a similar system? There's a rumour that some Unix C compilers do similar things. Generally though, it seems a waste, particularly for Fortran. Consider the time spent in a subroutine versus a savings of two instructions -- hardly worth the time to specify an extra compile flag. Inlining before optimization has the potential for being a lot more interesting. The hard part is choosing (automatically) routines to inline. It's fairly easy to eliminate most of the calls in a program, but is the code any faster? Often not. On many systems, inlining actually produces slower code in many cases, despite all the obvious intuitions. It's particularly frustrating in view of the hefty time penalties paid to optimize the resulting humongous routines. -- Preston Briggs looking for the great leap forward preston@titan.rice.edu