This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How do I modify SSA and copy basic blocks?
- From: Steve Ellcey <sellcey at imgtec dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: Jeff Law <law at redhat dot com>, <gcc at gcc dot gnu dot org>
- Date: Thu, 25 Apr 2013 09:24:43 -0700
- Subject: Re: How do I modify SSA and copy basic blocks?
- References: <1366749784 dot 29344 dot 120 dot camel at ubuntu-sellcey> <5176FC17 dot 6000108 at redhat dot com> <1366825088 dot 15384 dot 35 dot camel at ubuntu-sellcey> <51784134 dot 3060508 at redhat dot com> <1366844050 dot 15384 dot 93 dot camel at ubuntu-sellcey> <51789CF2 dot 5070505 at redhat dot com> <CAFiYyc1NsoEFjNyVaZmqrVRXQx3SKRh1u7L7cmn7ELoerGVEkA at mail dot gmail dot com>
On Thu, 2013-04-25 at 09:53 +0200, Richard Biener wrote:
> > Interesting you should mention this; one of the things I really want to get
> > back to is a more generic mechanism to copy block regions.
>
> We have gimple_duplicate_sese_region for this. It may be not perfect though.
> Eventually it should be changed to handle SEME regions as well and all
> loop copying / versioning code should use it as well (though I don't think
> any of the loop copying / versioning code handles multiple exits).
>
> I've slowly started to move us in this direction by removing duplicate
> functionality
> in the compiler as I come along it ...
>
> Richard.
This looks interesting. If it handled SEME regions I think I could use
it because any single block by itself is going to be an SEME region,
right? I notice the routine does not update the SSA web. Is there a
reason for that? It looks like copy_loop_headers calls update_ssa after
it calls gimple_duplicate_sese_region (the only use of
gimple_duplicate_sese_region that I see). Unfortunately, at least some
of the blocks I want to copy have multiple exit edges where an SSA
variable defined in that block is needed on each of the exit edges from
the block. Do you know what bad things will happen if I call this with
a block that is SEME instead of SESE? Is there anyway (even if it was a
hack) that I could compensate for it by regenerating some of the
information, i.e. freeing the dominator information so it gets
recalculated from scratch or something like that?
Steve Ellcey
sellcey@imgtec.com