public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] Remove useless sets/clears of EDGE_CAN_FALLTHRU
@ 2012-07-14 21:40 Steven Bosscher
  2012-07-16  8:54 ` Richard Guenther
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Bosscher @ 2012-07-14 21:40 UTC (permalink / raw)
  To: GCC Patches

Hello,

EDGE_CAN_FALLTHRU is internal to bb-reorder.c,
set_edge_can_fallthru_flag() clears it on all edges and computes it
fresh for bb-reorder.

The test in rtl_verify_flow_info_1 has to stay because bb-reorder
doesn't clean up the flag after it's done.

Bootstrapped&tested on powerpc64-unknown-linux-gnu. OK?

Ciao!
Steven

        * haifa-sched.c (init_before_recovery): Do not set EDGE_CAN_FALLTHRU.
        * cfgrtl.c (force_nonfallthru_and_redirect): Likewise.

Index: haifa-sched.c
===================================================================
--- haifa-sched.c       (revision 189478)
+++ haifa-sched.c       (working copy)
@@ -7193,8 +7193,7 @@ init_before_recovery (basic_block *before_recovery

       redirect_edge_succ (e, single);
       make_single_succ_edge (single, empty, 0);
-      make_single_succ_edge (empty, EXIT_BLOCK_PTR,
-                            EDGE_FALLTHRU | EDGE_CAN_FALLTHRU);
+      make_single_succ_edge (empty, EXIT_BLOCK_PTR, EDGE_FALLTHRU);

       label = block_label (empty);
       x = emit_jump_insn_after (gen_jump (label), BB_END (single));
Index: cfgrtl.c
===================================================================
--- cfgrtl.c    (revision 189478)
+++ cfgrtl.c    (working copy)
@@ -1365,8 +1365,8 @@ force_nonfallthru_and_redirect (edge e, basic_bloc
         one and create separate abnormal edge to original destination.
         This allows bb-reorder to make such edge non-fallthru.  */
       gcc_assert (e->dest == target);
-      abnormal_edge_flags = e->flags & ~(EDGE_FALLTHRU | EDGE_CAN_FALLTHRU);
-      e->flags &= EDGE_FALLTHRU | EDGE_CAN_FALLTHRU;
+      abnormal_edge_flags = e->flags & ~EDGE_FALLTHRU;
+      e->flags &= EDGE_FALLTHRU;
     }
   else
     {

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] Remove useless sets/clears of EDGE_CAN_FALLTHRU
  2012-07-14 21:40 [patch] Remove useless sets/clears of EDGE_CAN_FALLTHRU Steven Bosscher
@ 2012-07-16  8:54 ` Richard Guenther
  2012-07-16  9:04   ` Steven Bosscher
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Guenther @ 2012-07-16  8:54 UTC (permalink / raw)
  To: Steven Bosscher; +Cc: GCC Patches

On Sat, Jul 14, 2012 at 11:40 PM, Steven Bosscher <stevenb.gcc@gmail.com> wrote:
> Hello,
>
> EDGE_CAN_FALLTHRU is internal to bb-reorder.c,
> set_edge_can_fallthru_flag() clears it on all edges and computes it
> fresh for bb-reorder.
>
> The test in rtl_verify_flow_info_1 has to stay because bb-reorder
> doesn't clean up the flag after it's done.
>
> Bootstrapped&tested on powerpc64-unknown-linux-gnu. OK?

Ok.

Maybe we should rename EDGE_CAN_FALLTHRU to EDGE_PLF_1
and have a #define in bb-reorder.c then?  Other passes might use
it for their pass-local handling then and would not be content to set/unset
it.

Thanks,
Richard.

> Ciao!
> Steven
>
>         * haifa-sched.c (init_before_recovery): Do not set EDGE_CAN_FALLTHRU.
>         * cfgrtl.c (force_nonfallthru_and_redirect): Likewise.
>
> Index: haifa-sched.c
> ===================================================================
> --- haifa-sched.c       (revision 189478)
> +++ haifa-sched.c       (working copy)
> @@ -7193,8 +7193,7 @@ init_before_recovery (basic_block *before_recovery
>
>        redirect_edge_succ (e, single);
>        make_single_succ_edge (single, empty, 0);
> -      make_single_succ_edge (empty, EXIT_BLOCK_PTR,
> -                            EDGE_FALLTHRU | EDGE_CAN_FALLTHRU);
> +      make_single_succ_edge (empty, EXIT_BLOCK_PTR, EDGE_FALLTHRU);
>
>        label = block_label (empty);
>        x = emit_jump_insn_after (gen_jump (label), BB_END (single));
> Index: cfgrtl.c
> ===================================================================
> --- cfgrtl.c    (revision 189478)
> +++ cfgrtl.c    (working copy)
> @@ -1365,8 +1365,8 @@ force_nonfallthru_and_redirect (edge e, basic_bloc
>          one and create separate abnormal edge to original destination.
>          This allows bb-reorder to make such edge non-fallthru.  */
>        gcc_assert (e->dest == target);
> -      abnormal_edge_flags = e->flags & ~(EDGE_FALLTHRU | EDGE_CAN_FALLTHRU);
> -      e->flags &= EDGE_FALLTHRU | EDGE_CAN_FALLTHRU;
> +      abnormal_edge_flags = e->flags & ~EDGE_FALLTHRU;
> +      e->flags &= EDGE_FALLTHRU;
>      }
>    else
>      {

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] Remove useless sets/clears of EDGE_CAN_FALLTHRU
  2012-07-16  8:54 ` Richard Guenther
@ 2012-07-16  9:04   ` Steven Bosscher
  2012-07-16  9:30     ` Richard Guenther
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Bosscher @ 2012-07-16  9:04 UTC (permalink / raw)
  To: Richard Guenther; +Cc: GCC Patches

On Mon, Jul 16, 2012 at 10:53 AM, Richard Guenther
<richard.guenther@gmail.com> wrote:
> Maybe we should rename EDGE_CAN_FALLTHRU to EDGE_PLF_1
> and have a #define in bb-reorder.c then?  Other passes might use
> it for their pass-local handling then and would not be content to set/unset
> it.

I intend to do a lot more cleanups on the edge and basic block flags
(that depends on the dumpfile.h patch, eagerly awaiting your ACK or
comments ;-).

For EDGE_CAN_FALLTHRU I was more thinking of a pointer map or an
sbitmap on an edge list, tbd. Or, like you suggest, make it a flag
available for passes to use. That would also help for a few other
flags (EDGE_LOOP_EXIT, EDGE_EXECUTABLE, ...).

Ciao!
Steven

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] Remove useless sets/clears of EDGE_CAN_FALLTHRU
  2012-07-16  9:04   ` Steven Bosscher
@ 2012-07-16  9:30     ` Richard Guenther
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Guenther @ 2012-07-16  9:30 UTC (permalink / raw)
  To: Steven Bosscher; +Cc: GCC Patches

On Mon, Jul 16, 2012 at 11:03 AM, Steven Bosscher <stevenb.gcc@gmail.com> wrote:
> On Mon, Jul 16, 2012 at 10:53 AM, Richard Guenther
> <richard.guenther@gmail.com> wrote:
>> Maybe we should rename EDGE_CAN_FALLTHRU to EDGE_PLF_1
>> and have a #define in bb-reorder.c then?  Other passes might use
>> it for their pass-local handling then and would not be content to set/unset
>> it.
>
> I intend to do a lot more cleanups on the edge and basic block flags
> (that depends on the dumpfile.h patch, eagerly awaiting your ACK or
> comments ;-).

See your inbox ;)

> For EDGE_CAN_FALLTHRU I was more thinking of a pointer map or an
> sbitmap on an edge list, tbd. Or, like you suggest, make it a flag
> available for passes to use. That would also help for a few other
> flags (EDGE_LOOP_EXIT, EDGE_EXECUTABLE, ...).

Indeed - I prefer the pass-specific flags approach, we seem to have this
almost everywhere.

Richard.

> Ciao!
> Steven

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-07-16  9:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-14 21:40 [patch] Remove useless sets/clears of EDGE_CAN_FALLTHRU Steven Bosscher
2012-07-16  8:54 ` Richard Guenther
2012-07-16  9:04   ` Steven Bosscher
2012-07-16  9:30     ` Richard Guenther

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).