Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!spool.mu.edu!munnari.oz.au!musket!zs From: zs@cs.mu.OZ.AU (Zoltan Somogyi) Newsgroups: comp.arch Subject: Re: Optimising C compiler question Message-ID: Date: 19 Apr 91 07:17:18 GMT References: <1991Apr8.193155.3911@vax5.cit.cornell.edu> <1991Apr11.003431.24918@alzabo.ocunix.on.ca> <9526@cognos.UUCP> <1991Apr15.134417.24380@bigsur.uucp> <9537@cognos.UUCP> Sender: news@cs.mu.oz.au Distribution: comp Lines: 22 dhoyt@ux.acs.umn.edu (David Hoyt) writes: > ... a compiler that >uses static codepath analysis in conjunction with pc sampling (or other >tracing mechinisms) can provide optimal (or near optimal) register >allocation. With good benchmarks the compiler would have sufficient >information to 'know' the code's behavior in the more general case as well. >I sure people have done research in this area, but does any comercial >compiler take advantage of this kind of analysis? There is at least one compiler suite (the one by MIPS) that has this kind of functionality. The idea is that you compile your program with profiling, run it a few times on the kind of data you want to optimize its behavior for (i.e. typical data), and then compile the program again, but this time give the data gathered by the profiling process to the compiler as well. This approach gives the compiler a reasonably close approximation to perfect information about the run-time behaviour of the program. This information can be used not only for register allocation within procedures, but also procedure inlining (only at most frequent call sites) and interprocedural register allocation. The MIPS suite does all these things (and more). Zoltan Somogyi zs@cs.mu.OZ.AU