This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] outer-loop parallelization support
- From: Razya Ladelsky <RAZYA at il dot ibm dot com>
- To: Richard Guenther <richard dot guenther at gmail dot com>
- Cc: Alon Dayan <ALOND at il dot ibm dot com>, gcc-graphite at googlegroups dot com, gcc-patches at gcc dot gnu dot org, Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>
- Date: Mon, 19 Oct 2009 12:03:27 +0200
- Subject: Re: [PATCH] outer-loop parallelization support
>
> +/* Add phi arguments to the phi nodes in E_COPY->dest according to
> + the phi arguments coming from the equivalent edge at
> + the phi nodes of DEST. */
> +
> +static void
> +add_phi_args_after_redirect (edge e_copy, basic_block dest)
> +{
> + basic_block bb, bb_copy = e_copy->src;
> + gimple_stmt_iterator psi, psi_copy;
> + gimple phi, phi_copy;
> + tree def;
> + edge e;
> +
> + bb = get_bb_original (bb_copy);
>
> If you can use get_bb_original for e_copy->src you should
> be able to do it for e_copy->dest as well, no? Thus, no need
Not exactly.
e_copy->dest doesn't have to be (and actually is not for the cases I
looked into) a copy of DEST.
> to pass dest to the function. Either do that or pass the original
> edge.
>
I can pass the original edge, but I need to find it the same way
I do here, using find_edge (cause there's no mapping of the edges).
> + e = find_edge (bb, dest);
>
> which would also get rid of this.
Again, I can move it to the caller of add_phi_args_after_redirect,
but I need it.
>
> +/* Check if BB belongs to region REGION. */
> +
> +static bool
> +bb_in_region(basic_block bb, basic_block *region, int n_region)
> +{
> + int i;
> +
> + for (i = 0; i < n_region; i++)
> + {
> + if (region[i]==bb)
> + return true;
> + }
> +
> + return false;
> +}
>
> This doesn't look like a good predicate due to its linear complexity.
You
> call it once, please inline it there to avoid somebody else exporting
and
> re-using it.
Ok.
I will actually follow the way it is done in other places, and replace the
call to
bb_in_region(bb, region) with 'bb & BB_DUPLICATED'.
The region's bbs will be initialized with the BB_DUPLICATED flag before
the call,
and cleared after.
Thanks for your comments,
Razya