public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/22568] Should use cmov in some stituations Date: Fri, 02 Sep 2005 09:54:00 -0000 [thread overview] Message-ID: <20050902095453.14174.qmail@sourceware.org> (raw) In-Reply-To: <20050720134633.22568.arndt@jjj.de> ------- Additional Comments From rguenth at gcc dot gnu dot org 2005-09-02 09:54 ------- Blindly applying ifcvt to something like int a,b; void foo(int flag) { int x; if (flag) x=a,a=b,b=x; } because we're presented with if (flag) { int reg_a = a; x = reg_a; int reg_b = b; a = reg_b; b = x; } and we get cmovs for loading a,b into pseudos instead of loading them unconditionally. F.i. int a,b; void foobar(int flag) { if (flag) a = b; } will become foobar: movl 4(%esp), %eax # flag, flag testl %eax, %eax # flag cmovne b, %edx # b,, b movl a, %eax # a, tmp61 cmovne %edx, %eax # b,, tmp61 movl %eax, a # tmp61, a ret notice how we special-cased the _store_ to use a temporary. I'll try applying the same for loads. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22568
next prev parent reply other threads:[~2005-09-02 9:54 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2005-07-20 14:21 [Bug c++/22568] New: " arndt at jjj dot de 2005-07-20 14:27 ` [Bug c++/22568] " matz at suse dot de 2005-07-20 15:14 ` [Bug rtl-optimization/22568] " pinskia at gcc dot gnu dot org 2005-08-31 9:42 ` rguenth at gcc dot gnu dot org 2005-09-01 12:38 ` rguenth at gcc dot gnu dot org 2005-09-02 9:47 ` bonzini at gcc dot gnu dot org 2005-09-02 9:54 ` rguenth at gcc dot gnu dot org [this message] [not found] <bug-22568-11024@http.gcc.gnu.org/bugzilla/> 2006-01-15 3:14 ` pinskia at gcc dot gnu dot org 2006-01-15 4:05 ` pinskia at gcc dot gnu dot org 2006-01-15 19:11 ` rguenth at gcc dot gnu dot org [not found] <bug-22568-4@http.gcc.gnu.org/bugzilla/> 2012-02-08 21:01 ` pinskia at gcc dot gnu.org 2021-05-24 6:13 ` pinskia at gcc dot gnu.org
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=20050902095453.14174.qmail@sourceware.org \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@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: linkBe 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).