From: iainf@spider.com (Iain A F Fleming)
Newsgroups: comp.editors,comp.sys.transputer
Subject: Re: Folding editors
Date: 18 Nov 1998 11:01:24 +0000
Organization: Spider Software Ltd
Sender: iainf@belhaven.spider.com
Distribution: inet
Message-Id: <6rk90t464b.fsf@belhaven.spider.com>
References: <36374B57.168B9492@pact.srf.ac.uk>
    <71aj0c$oc$1@fangorn.moria.de> <6r1znq7264.fsf@belhaven.spider.com>
    <3639BEFD.2CC25E3C@esgem.com> <6r4ssm59ay.fsf@belhaven.spider.com>
    <QuruoDADsfO2Ewhc@cawley.demon.co.uk>
    <y4n26clw5i.fsf@mailhost.neuroinformatik.ruhr-uni-bochum.de>
    <6rhfwi4ee6.fsf@belhaven.spider.com> <363EEB84.5CAD538B@roke.co.uk>
    <6rvhkw20nk.fsf@belhaven.spider.com> <364CBB49.ABE8624B@oucs.ox.ac.uk>
    <6r90hb7vgg.fsf@belhaven.spider.com> <3651C1BA.16126C2@roke.co.uk>
In-Reply-To: Richard Beton's message of Tue, 17 Nov 1998 18:34:34 +0000
Xref: ukc comp.editors:32298 comp.sys.transputer:8929


The entity calling itself Richard Beton wrote:
> 
>  I'm not sure whether the compiler optimisation is necessarily hindered by
>  deep folding, although with some languages and some compilers I wouldn't
>  be surprised.

On the Transputer, efficiency of instruction coding (density) is affected by
stack offset a variable is placed at. Deep nested blocks, with variables
live across the inner blocks, hinders placing all heavily-used variables at
lower slots (>16).  Moving inner blocks to independent functions (in the
Transputer C compiler, at least) could well reduce code size, and improve
speed. (I know this as I wrote parts of both the inmos Occam & C compilers.)
On other architecures, the equivalent cost will be register spilling.

Also, determining data-flow in any program is always a worst-case. As you
make the program more complicated, the more pessimistic the compiler will
become. Common sub-expression analysis becomes less tractable.

>  In occam, the nesting depth would be no hindrance to compiler
>  optimisation and could possibly aid it.

Assuming that you had an optimising Occam compiler. As far as I know the
inmos optimising Occam compiler, although very good, never (officialy)
escaped from Aztec West.

-- 
 Iain A F Fleming               http://www.spider.com/
 Spider Sofware Ltd  Leith  Scotland  +44.131.475.7045

