This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] [RFC] loop versioning
>
> On Jan 5, 2004, at 10:35 PM, Richard Henderson wrote:
>
> >Anyway, you should know that there are already routines to copy
> >statements and blocks. So all of this code looks redundant.
>
> tree_duplicate_bb () is more suitable to copy loop header. For
> other basic blocks inside loop, while duplicating a basic block
> I may not have corresponding edge available. Because it is possible
> that bb at other end of edge does not yet have corresponding
> duplicate bb. So what I do is, duplicate all basic blocks and
> then make edge for second loop by following edges of original loop.
> Plus there can be more than one incoming edges and tree_duplicate_bb()
> does not handle it.
In addition do basic block duplication code, we may have something like
duplicate_zone that will take a set of basic blocks and duplicate the
code together with it's internal edges. I would like to see this
implemented at the top of duplicate_bb so we get it working for both RTL
and trees. (duplcate_bb shall be virtualized) For RTL this is already
done in Zdenek's loop unroller code so one can use this as a base.
Honza
>
> As I understand tree_duplicate_bb() performs this operation
>
> before
> ---- edge e1 ----> [bb1]
>
> after
> --- edge e1 --+ [bb1]
> |
> +---> [bb2]
>
> What I need to do for loop versioning is:
>
> before
> ---- edge e1 ---> [bb1] ---- edge e2 --->
> after
> ---- edge e1 ---> [bb1] ---- edge e2 --->
> ---- edge e21 ---> [bb21] ---- edge e22 --->
>
>
> And comment on top of tree_duplicate_bb () says that it does not
> work over SSA. At the moment, I'm trying to make loop versioning
> work over SSA.
>
> If you think, I should update tree_duplicate_bb () and related APIs
> to satisfy these requirements then I'll follow that path.
>
> Thank you,
> -
> Devang