Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!uunet!convex!kcollins From: kcollins@convex.com (Kirby L. Collins) Newsgroups: comp.arch Subject: Re: Optimising C compiler question Message-ID: Date: 18 Apr 91 16:19:19 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: newsadm@convex.com (news access account) Distribution: comp Organization: Convex Computer Corporation, Richardson, Tx. Lines: 13 Nntp-Posting-Host: dhostwo.convex.com In <9537@cognos.UUCP> jimp@cognos.UUCP (Jim Patterson) writes: >If the compiler considers both paths equally likely it may >continue to assign the single register to j, or could dump and load j >and k into the single register as required. However, we have information >the compiler doesn't, to wit that the "j" path will not normally be >executed, so we can see that allocating a register to j but not k, or Rather than provide a means for the programmer to "hand optimize" register allocation, a more useful solution would be to give the programmer a way to inform the compiler about branch frequency. If the compiler has as much information as the programmer, it ought to do as good or better a job than the programmer (we hope $-).