public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: Kyrill Tkachov <kyrylo.tkachov@arm.com>,
	       GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH][RTL-ifcvt] PR rtl-optimization/67749: Do not emit separate SET insn in IF-ELSE case
Date: Mon, 02 Nov 2015 22:46:00 -0000	[thread overview]
Message-ID: <5637E7D8.1010509@redhat.com> (raw)
In-Reply-To: <562F8EFB.9080000@arm.com>

On 10/27/2015 08:49 AM, Kyrill Tkachov wrote:
> Hi all,
>
> This patch fixes the gcc.dg/ifcvt-2.c test for x86_64 where we were
> failing to if-convert. This was because in my patch at
> https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=228194 which
> tried to emit a SET to move the source of insn_a or insn_b (that came
> from the test block) into a temporary. A SET however, is not always
> enough. For example, on x86_64 in order for the resulting insn to be
> recognised it frequently needs to be in PARALLEL with a (clobber
> (reg:CC FLAGS_REG)). This leads to the insn not being recognised.
I don't think it affects the approach you've chosen, but I'm mentioning 
it for future reference.

gcse.c has some helper code (that probably ought to move into a more 
generic file) that will test for this situation.  Search for the 
instances of recog.  It essentially does something like

emit_insn (gen_rtx_SET (...))

And tries to recognize the result to determine if it's valid.


>
> So this patch removes that SET and instead generates a couple of
> temporary pseudos that gets passed on a bit later to the code that
> loads the operands into registers when they're not general_operand.
> This way we just modify the existing (recognisable) sets, allowing us
> to if-convert the testcase.
That sounds much more reasonable, assuming that the original 
destinations were just used once and those uses are guaranteed to be 
going away.



>
> Bootstrapped and tested on x86_64, arm, aarch64.
>
> Ok for trunk?

What happens in the case were noce_emit_bb returns a failure?  We've 
modified the original insns to use the new pseudos.  Won't this result 
in the original pseudo's uses using undefined values?

jeff

  reply	other threads:[~2015-11-02 22:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-27 14:49 Kyrill Tkachov
2015-11-02 22:46 ` Jeff Law [this message]
2015-11-03  9:09   ` Kyrill Tkachov
2015-11-06 22:48     ` Jeff Law

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=5637E7D8.1010509@redhat.com \
    --to=law@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kyrylo.tkachov@arm.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).