Hi Lukas:

On 09 Dec 2011, at 16:54, Lukas Renggli wrote:

> Hi Stefan,
> 
> I think there is a lint rule that does that: TempNotRead ... I don't
> have an image at hand, but I can check tonight if you haven't found it
> until then.

Thanks, I checked the lint rules, but well, while there are some rules which 
provide related analysis, what I was looking for is slightly more complex.

I basically want to be able to automatically reduce the number of temps for the 
following example to one:

| t1 t2 |
t1 := o1 foo.
o2 bar: t1.
o3 bar: t1.

t2 := o1 foo.
o2 bar: t2.
o3 bar: t2.

Of course it is slightly more complex than that, because the usage of the temps 
is not just in a sequence, but can be also in blocks, or nested expressions.

But in this simple example, I could remove t2 and use t1 instead.

Well, for the moment, I just removed the offending test from the system, but 
since my benchmarks do not run yet, I fear that I might run into the problem 
with real code, too.

Best regards
Stefan



> 
> Lukas
> 
> On 9 December 2011 16:29, Stefan Marr <ph...@stefan-marr.de> wrote:
>> Hi all,
>> Hi Lukas:
>> 
>> Do you know if anyone ever implemented a rewriter for the RB AST that 
>> reduces the amount of temporary variables if possible?
>> 
>> I have a naive rewriting step that creates too many temps, but some of them 
>> are not strictly necessary.
>> 
>> However, currently, I run into 'Cannot compile -- stack including temps is 
>> too deep' which is, well, ehm, not so nice.
>> 
>> In case anyone has something in that direction, I would be interested.
>> 
>> Thanks
>> Stefan
>> 
>> --
>> Stefan Marr
>> Software Languages Lab
>> Vrije Universiteit Brussel
>> Pleinlaan 2 / B-1050 Brussels / Belgium
>> http://soft.vub.ac.be/~smarr
>> Phone: +32 2 629 2974
>> Fax:   +32 2 629 3525
>> 
> 
> 
> 
> -- 
> Lukas Renggli
> www.lukas-renggli.ch

-- 
Stefan Marr
Software Languages Lab
Vrije Universiteit Brussel
Pleinlaan 2 / B-1050 Brussels / Belgium
http://soft.vub.ac.be/~smarr
Phone: +32 2 629 2974
Fax:   +32 2 629 3525


Reply via email to