Path: utzoo!yunexus!davecb From: davecb@yunexus.UUCP (David Collier-Brown) Newsgroups: comp.arch Subject: Re: Register usage Summary: Compilers **can** do better, but if you don't have a good one Keywords: profile, register allocation Message-ID: <1963@yunexus.UUCP> Date: 18 May 89 02:28:10 GMT Article-I.D.: yunexus.1963 References: <952@aber-cs.UUCP> Reply-To: davecb@yunexus.UUCP (David Collier-Brown) Organization: Bimodal: [Interleaf Canada | York U. Computing Services] Lines: 30 In article <952@aber-cs.UUCP> pcg@cs.aber.ac.uk (Piercarlo Grandi) writes: [responding to some factual information on register usage] >I thank you enormously. This quote greatly cheers me up. This is a very good >support for my position on "register" (where a competent programmer is >expected to do this, with great simplication of the compiler, because >compilers cannot possibly know which variables are the most frequently used >dynamically). True if you define "compiler" narrowly (ie, normally). However, if you think of an optimization "environment", you can justify feeding the results of a profile back into the compiler to guide register allocation. I would tend to structure this as an optional "pass" (well, pseudo-pass) for purely practical reasons... And if you want to experiment with the idea right now, consider writing an output processor for a profiler which orders variables by use in individual functions, and then another utility to rewrite the source code with register declarations for the X hottest variables per function iff the call cost/run cost ratio would not be deranged thereby. (It is fairly hard (:-)). --dave (only two more days to monomania!) c-b -- David Collier-Brown, | {toronto area...}lethe!dave 72 Abitibi Ave., | Joyce C-B: Willowdale, Ontario, | He's so smart he's dumb. CANADA. 223-8968 |