This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] How to increase PHI capacity?
- From: law at redhat dot com
- To: Steven Bosscher <s dot bosscher at student dot tudelft dot nl>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 04 Aug 2003 10:34:17 -0600
- Subject: Re: [tree-ssa] How to increase PHI capacity?
- Reply-to: law at redhat dot com
In message <1060010146.9010.35.camel@steven.lr-s.tudelft.nl>, Steven Bosscher w
rites:
>Hi,
>
>I'm trying to kill jumps to jumps. We seem to create lots of them and
>it should be not too difficult to get rid of them at the tree level.
>
>I was playing with some ideas and I bumped into this problem with PHI
>node capacity. Consider these three basic blocks: bb ends with a jump
>to old_dest which is nothing else but another jump to new_dest:
Note that the infrastructure you need to do this would go a long way to
solving a couple problems with us missing redundancies. So I'm quite
interested in your work.
>arg 1(220) has to be duplicated for the edge from 22 to 222. But the
>PHI_CAPACITY of the PHIs is only 3; there's no room for a fourth
>argument... Gives me an abort in add_phi_arg(), of course.
>
>There doesn't seem to be an easy way to increase the capacity of a PHI,
>at least I can't find it. Is this just missing, or have my thoughts
>completely misguided me here?
I don't believe there is an interface to increase a PHI argument's
capacity -- those are pre-computed during PHI insertion. We allow them
to shrink, but not expand.
It's rather icky, but you could "expand" the PHI node by creating a new
PHI of the desired size and copying all the existing data from the old
one into the new one. Then you could call add_phi_arg on the new phi
nodes to add your arguments.
Alternately you could make the PHI arguments a virtual array. Those can
shrink/grow as needed. Note that I don't think we necessarily have the
ability to have a varray type in our tree structure, so you might need to
add that.
jeff