Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!news.cs.indiana.edu!msi.umn.edu!cs.umn.edu!ux.acs.umn.edu!dhoyt From: dhoyt@ux.acs.umn.edu (David Hoyt) Newsgroups: comp.arch Subject: Re: Optimising C compiler question Message-ID: Date: 18 Apr 91 14:40:50 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> Distribution: comp Organization: University of Minnesota, Academic Computing Services Lines: 18 In <9537@cognos.UUCP> jimp@cognos.UUCP (Jim Patterson) writes: > My point is simply >that due to lack of information, no optimizer can provide an optimal >register allocation for best performance (i.e. speed) of a specific >application and specific data inputs. The example cites a situation >where a "statistical" guess as to the code's behaviour is likely to >lead to wrong decisions by the optimizer. I am taking your quote slighly out of context, however; 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? david | dhoyt@ux.acs.umn.edu