This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch][graphite] Fix flags set by split_block
- From: Richard Guenther <rguenther at suse dot de>
- To: Sebastian Pop <sebpop at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Zdenek Dvorak <ook at ucw dot cz>
- Date: Wed, 22 Oct 2008 12:02:52 +0200 (CEST)
- Subject: Re: [patch][graphite] Fix flags set by split_block
- References: <cb9d34b20810211655l126bdf8brd57f7d9747303090@mail.gmail.com>
On Tue, 21 Oct 2008, Sebastian Pop wrote:
> Hi,
>
> The following bug occurs at least 7 times in spec2k6:
>
> 959.c:28: error: edge from 17 to 57 should be marked irreducible
> 959.c:28: error: basic block 57 should be marked irreducible
> 959.c:28: error: edge from 34 to 53 should be marked irreducible
> 959.c:28: error: basic block 53 should be marked irreducible
>
> split_block_after_labels does not correctly update the flags for the
> edges and bbs it creates. Is this patch correct, or should these
> flags be set by split_block instead?
I think split_block should do this instead (after all, split_edge
does). But Zdenek may know better?
Richard.
> * graphite.c (create_single_entry_edge): Set
> EDGE_IRREDUCIBLE_LOOP and BB_IRREDUCIBLE_LOOP.
>
> Index: graphite.c
> ===================================================================
> --- graphite.c (revision 141245)
> +++ graphite.c (working copy)
> @@ -1636,7 +1636,19 @@ create_single_entry_edge (sd_region *reg
> loop_latch_edge (region->entry->loop_father)->src,
> region->exit))
> {
> + edge e = single_succ_edge (region->entry);
> + int e_flags = e->flags;
> + int b_flags = region->entry->flags;
> + bool irreducible_e = e_flags & EDGE_IRREDUCIBLE_LOOP;
> + bool irreducible_b = region->entry->flags & BB_IRREDUCIBLE_LOOP;
> edge forwarder = split_block_after_labels (region->entry);
> +
> + if (irreducible_e)
> + forwarder->flags = e_flags;
> +
> + if (irreducible_b)
> + forwarder->dest->flags = b_flags;
> +
> region->entry = forwarder->dest;
> }
> else
>
>
--
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 - GF: Markus Rex