From: Steven Bosscher <stevenb.gcc@gmail.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: [patch] make gcse.c respect -fno-gcse-lm
Date: Sun, 10 Mar 2013 23:18:00 -0000 [thread overview]
Message-ID: <CABu31nPKUkhm3BprYx=V_TQCjLwRg9RwaT1O89e6FJM3GBNu8A@mail.gmail.com> (raw)
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);
next reply other threads:[~2013-03-10 23:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-10 23:18 Steven Bosscher [this message]
2013-03-11 9:10 ` Richard Biener
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CABu31nPKUkhm3BprYx=V_TQCjLwRg9RwaT1O89e6FJM3GBNu8A@mail.gmail.com' \
--to=stevenb.gcc@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).