public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] make gcse.c respect -fno-gcse-lm
@ 2013-03-10 23:18 Steven Bosscher
  2013-03-11  9:10 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Bosscher @ 2013-03-10 23:18 UTC (permalink / raw)
  To: GCC Patches

Hello,

RTL PRE has an option to disable load motion. This option works fine,
except that all analysis for load motion is still performed.

This patch stops gcse.c from recording memory sets for -fno-gcse-lm,
and conservatively returns true in oprs_unchanged_p for any MEM.

Bootstrapped&tested on {x86_64,powerpc64}-unknown-linux-gnu. OK?

Ciao!
Steven


        * gcse.c (oprs_unchanged_p): Respect flag_gcse_lm.
        (record_last_mem_set_info): Likewise.

Index: gcse.c
===================================================================
--- gcse.c      (revision 196576)
+++ gcse.c      (working copy)
@@ -890,8 +890,9 @@ oprs_unchanged_p (const_rtx x, const_rtx
       }

     case MEM:
-      if (load_killed_in_block_p (current_bb, DF_INSN_LUID (insn),
-                                 x, avail_p))
+      if (! flag_gcse_lm
+         || load_killed_in_block_p (current_bb, DF_INSN_LUID (insn),
+                                    x, avail_p))
        return 0;
       else
        return oprs_unchanged_p (XEXP (x, 0), insn, avail_p);
@@ -1471,10 +1472,14 @@ canon_list_insert (rtx dest ATTRIBUTE_UN
 static void
 record_last_mem_set_info (rtx insn)
 {
-  int bb = BLOCK_FOR_INSN (insn)->index;
+  int bb;
+
+  if (! flag_gcse_lm)
+    return;

   /* load_killed_in_block_p will handle the case of calls clobbering
      everything.  */
+  bb = BLOCK_FOR_INSN (insn)->index;
   modify_mem_list[bb].safe_push (insn);
   bitmap_set_bit (modify_mem_list_set, bb);

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

* Re: [patch] make gcse.c respect -fno-gcse-lm
  2013-03-10 23:18 [patch] make gcse.c respect -fno-gcse-lm Steven Bosscher
@ 2013-03-11  9:10 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2013-03-11  9:10 UTC (permalink / raw)
  To: Steven Bosscher; +Cc: GCC Patches

On Mon, Mar 11, 2013 at 12:17 AM, Steven Bosscher <stevenb.gcc@gmail.com> wrote:
> Hello,
>
> RTL PRE has an option to disable load motion. This option works fine,
> except that all analysis for load motion is still performed.
>
> This patch stops gcse.c from recording memory sets for -fno-gcse-lm,
> and conservatively returns true in oprs_unchanged_p for any MEM.
>
> Bootstrapped&tested on {x86_64,powerpc64}-unknown-linux-gnu. OK?

Ok.

Thanks,
Richard.

> Ciao!
> Steven
>
>
>         * gcse.c (oprs_unchanged_p): Respect flag_gcse_lm.
>         (record_last_mem_set_info): Likewise.
>
> Index: gcse.c
> ===================================================================
> --- gcse.c      (revision 196576)
> +++ gcse.c      (working copy)
> @@ -890,8 +890,9 @@ oprs_unchanged_p (const_rtx x, const_rtx
>        }
>
>      case MEM:
> -      if (load_killed_in_block_p (current_bb, DF_INSN_LUID (insn),
> -                                 x, avail_p))
> +      if (! flag_gcse_lm
> +         || load_killed_in_block_p (current_bb, DF_INSN_LUID (insn),
> +                                    x, avail_p))
>         return 0;
>        else
>         return oprs_unchanged_p (XEXP (x, 0), insn, avail_p);
> @@ -1471,10 +1472,14 @@ canon_list_insert (rtx dest ATTRIBUTE_UN
>  static void
>  record_last_mem_set_info (rtx insn)
>  {
> -  int bb = BLOCK_FOR_INSN (insn)->index;
> +  int bb;
> +
> +  if (! flag_gcse_lm)
> +    return;
>
>    /* load_killed_in_block_p will handle the case of calls clobbering
>       everything.  */
> +  bb = BLOCK_FOR_INSN (insn)->index;
>    modify_mem_list[bb].safe_push (insn);
>    bitmap_set_bit (modify_mem_list_set, bb);

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

end of thread, other threads:[~2013-03-11  9:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-10 23:18 [patch] make gcse.c respect -fno-gcse-lm Steven Bosscher
2013-03-11  9:10 ` Richard Biener

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).