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: Fri, 06 Nov 2015 22:48:00 -0000	[thread overview]
Message-ID: <563D2E1D.3000700@redhat.com> (raw)
In-Reply-To: <563879D6.5030506@arm.com>

On 11/03/2015 02:09 AM, Kyrill Tkachov wrote:
> Hi Jeff,
>
> On 02/11/15 22:46, Jeff Law wrote:
>> 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.
>
> you mean compute_can_copy and can_copy_p? I was not aware of those.
> Interesting, they look like they
> can be useful in places indeed. I'll keep them in mind for any future work.
Yes.  Those.


>>
>> 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?
>
> We should be fine because we don't modify the original insns. We create
> a copy of them i.e.
> rtx_insn *copy_of_a = as_a <rtx_insn *> (copy_rtx (insn_a));
>
> and modify the SET_DEST of that. The original insn should still remain
> intact if any step in
> noce_try_cmove_arith fails, so we can revert back to the original sequence.
In that case, OK for the trunk.

Thanks,
jeff

      reply	other threads:[~2015-11-06 22:48 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
2015-11-03  9:09   ` Kyrill Tkachov
2015-11-06 22:48     ` Jeff Law [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=563D2E1D.3000700@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).