Joern RENNECKE wrote:
> Kenneth Zadeck wrote:
>
>>  
>>
>> The right way to do this is not to build chains but to define your own
>> dataflow problem to do this.  
>>
> But wouldn't I need to update the problem solution every time a change
> a bit of the
> program - which would be much more costly then doing a local update of
> some
> local def-firstuse or use-nextuse chains?
>
depending on what you are doing, you can update the solution in place. 
The point of the dataflow talk was not to say that you cannot do
anything incremental, it was to say that there are no good GENERAL
techniques.  Many times it is possible to update the solution precisely
if you have a very good understanding of the local conditions under
which the transformation is done on. 

The other trick it to do what I do in the new fast dce or the if-cvt on
the dataflow branch:
order the basic blocks so that it does not matter if you mess up the
solution. Generally a post order or a reverse postorder traversial of
the basic blocks will have the property that you can just mess things up
in a wave that moves from the beginning to the end or the end to the end
of the program without ever seeing the mess you make.

The only time you need to iterate is if you mess things up a the top of
a block that is the destination of the back edge.

This is a very useful trick in a compiler.  The cfg is your friend.

>> I think that what you want is something like the reaching uses problem
>> but you want a forwards version of this rather than a backwards version
>> as is defined in df-problems.c.
>>  
>>
> It is reaching uses, but the starting point is not necessarily a
> definition, but is more
> often a use.  I want to know about uses that are forward of the
> current site in the
> control flow, but I suppose this is best computed with a backward
> propagation of
> lifeness data.  AFAICT that's the same direction that the current
> reaching use problem
> has.
>
the gen set of the reaching uses problem is the set of uses.  the kill
set are the defs and the clobbers.  This is why the problem is called
"reaching uses".

Reply via email to