[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pcc-list
Subject:    Re: [Pcc] Question about freeing subtrees
From:       Anders Magnusson <ragge () ludd ! ltu ! se>
Date:       2016-01-10 16:45:14
Message-ID: 56928A9A.8010103 () ludd ! ltu ! se
[Download RAW message or body]

Den 2016-01-09 kl. 18:25, skrev Peter Kuschnerus:
> Anders Magnusson <ragge <at> ludd.ltu.se> writes:
>
>> Den 2016-01-08 kl. 17:06, skrev Peter Kuschnerus:
>>> Hi,
>>>
>>> For arch specific optimizations in pass1 in routine clocal,
>>> I intended to remove a subtree.
>>> But the routine p1tfree can not be used for this,
>>> if it is not shure, that this subtree is free of side effect.
>>>
>>> Instead I found the method to leave that subtree as is,
>>> and to insert a COMOP-node.
>>> The tree is then cleaned up im pass2.
>>>
>>> This seems to work well.
>>> My question now is:
>>> Is this method ok,
>>> or is there any problem.
>> Yep, you can just leave it and let it be cleaned later, that would
>> work.  Something like:
>>
>>     p = buildtree(COMOP, p, bcon(0));
>>
>> is legal.
>>
> Great, thanks !
>
> but now a similar problem in pass 2.
> For this I wrote a subroutine similar as tfree,
> but checking also for side effects.
> If a side effect, it is separated by
> DLIST_INSERT_BEFORE(ip, ipnode(p), qelem);
> This seem to work well also.
>
> Is there any problem with this ?
There is already a routine like this in pass2; deluseless();

It remove useless code from the top, and if it needs to it will
prepend the subtrees onto the ip.

-- Ragge

_______________________________________________
Pcc mailing list
Pcc@lists.ludd.ltu.se
https://lists.ludd.ltu.se/cgi-bin/mailman/listinfo/pcc
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic