From: Uros Bizjak <ubizjak@gmail.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Add peepholes to optimize reg0=mem1;reg0 op=nonmem2;mem1=reg0;if(reg0!=0) (PR rtl-optimization/49194)
Date: Sun, 29 May 2011 21:30:00 -0000 [thread overview]
Message-ID: <BANLkTi=FdA47UmRaJfDj5jzA8jwuiGdOHw@mail.gmail.com> (raw)
In-Reply-To: <20110527164052.GC17079@tyan-ft48-01.lab.bos.redhat.com>
On Fri, May 27, 2011 at 6:40 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> This patch adds a few peephole2s to help optimize if (!--*x) etc.
> This is something the combiner doesn't and can't easily handle, because in
> reg0 = mem1
> reg0 {+,-,&,|,^}= x
> mem1 = reg0
> cc = compare (reg0, 0)
> reg0 is used also by both the store and compare and there is no dependence
> in between them, so for reg0 = mem1; reg0 {+,-,&,|,^}= x; mem1 = reg0
> alone it can't do anything because reg0 is still needed and mem1 {+,-,&,|,^}= x
> doesn't set it, and the compare, being second user of reg0, doesn't have any
> LOG_LINKS and thus try_combine isn't called for it at all.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
>
> 2011-05-27 Jakub Jelinek <jakub@redhat.com>
>
> PR rtl-optimization/49095
> * config/i386/predicates.md (plusminuslogic_operator): New predicate.
> * config/i386/i386.md: Add peepholes for mem {+,-,&,|,^}= x; mem != 0.
>
> * gcc.target/i386/pr49095.c: New test.
This is OK.
On a related note, we probably want to set TARGET_READ_MODIFY_WRITE in
ix86_option_override_internal when optimize_size is in effect.
Thanks,
Uros.
prev parent reply other threads:[~2011-05-29 18:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-27 17:55 Jakub Jelinek
2011-05-29 21:30 ` Uros Bizjak [this message]
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='BANLkTi=FdA47UmRaJfDj5jzA8jwuiGdOHw@mail.gmail.com' \
--to=ubizjak@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
/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).