Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!olivea!decwrl!world!iecc!compilers-sender From: ram+@cs.cmu.edu (Rob MacLachlan) Newsgroups: comp.compilers Subject: Re: Parameter Passing Via Registers Keywords: optimize, registers, Pascal, Lisp Message-ID: <1991May1.021118.27749@cs.cmu.edu> Date: 1 May 91 02:11:18 GMT References: <1991Apr30.022048.4539@iecc.cambridge.ma.us> Sender: compilers-sender@iecc.cambridge.ma.us Reply-To: Rob MacLachlan Organization: School of Computer Science, Carnegie Mellon Lines: 22 Approved: compilers@iecc.cambridge.ma.us >Does anyone know how nested procedures affect the ability to pass parameters >via registers? If there was no up-level access everything would work fine, >but with this facility you get all sorts of problems. In "mostly functional" langauges like Lisp and ML, the compiler usually only forces out to memory variables that may be side-effected. Variables that are initialized once and then never reassigned don't cause any problems, since the value can be freely copied. >Uplevel access would also seem to affect dataflow analysis (the compiler >could think that a variable is 'dead' when in reality it's going to get >accessed by a nested local procedure. A common approach is to find all variables that may be accessed uplevel by a particular function, and then pass those values as additional implicit arguments. This causes the uplevel copy of the variable to be live until you are done with it. Robert MacLachlan (ram+@cs.cmu.edu) -- Send compilers articles to compilers@iecc.cambridge.ma.us or {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.