public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>,
	Richard Sandiford <richard.sandiford@arm.com>
Subject: Re: Make ifcvt clean up dead comparisons
Date: Fri, 12 Jul 2019 09:53:00 -0000	[thread overview]
Message-ID: <CAFiYyc3=vw3+XNQZCvPdbRk6Y-nGJ01VDtZDwwpmGsZYcAvx1w@mail.gmail.com> (raw)
In-Reply-To: <mpty313hedd.fsf@arm.com>

On Fri, Jul 12, 2019 at 10:00 AM Richard Sandiford
<richard.sandiford@arm.com> wrote:
>
> This change is needed to avoid a regression in gcc.dg/ifcvt-3.c
> for a later patch.  Without it, we enter CSE with a dead comparison left
> by if-conversion and then eliminate the second (live) comparison in
> favour of the dead one.  That's functionally correct in itself, but it
> meant that we'd combine the subtraction and comparison into a SUBS
> before we have a chance to fold away the subtraction.
>
> Tested on aarch64-linux-gnu, aarch64_be-elf and x86_64-linux-gnu.
> OK to install?

cfg_cleanup if it does, runs fast-dce after cleaning up the CFG so does
it make sense to do this in the caller instead?  (and after removing the
live problem just in case dce tries to keep that updated?)

Otherwise this is of course ok.

Richard.

> Richard
>
>
> 2019-07-11  Richard Sandiford  <richard.sandiford@arm.com>
>
> gcc/
>         * ifcvt.c: Include dce.h.
>         (if_convert): Call run_fast_dce if the pass changed something.
>
> Index: gcc/ifcvt.c
> ===================================================================
> --- gcc/ifcvt.c 2019-03-08 18:15:26.828777872 +0000
> +++ gcc/ifcvt.c 2019-07-12 08:58:21.787403345 +0100
> @@ -46,6 +46,7 @@
>  #include "rtl-iter.h"
>  #include "ifcvt.h"
>  #include "params.h"
> +#include "dce.h"
>
>  #ifndef MAX_CONDITIONAL_EXECUTE
>  #define MAX_CONDITIONAL_EXECUTE \
> @@ -5443,6 +5444,10 @@ if_convert (bool after_combine)
>                num_true_changes);
>      }
>
> +  if (num_updated_if_blocks)
> +    /* Get rid of any dead CC-related instructions.  */
> +    run_fast_dce ();
> +
>    if (optimize == 1)
>      df_remove_problem (df_live);
>

  reply	other threads:[~2019-07-12  9:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-12  8:08 Richard Sandiford
2019-07-12  9:53 ` Richard Biener [this message]
2019-07-12 10:32   ` Richard Sandiford
2019-07-12 10:36     ` Richard Biener
2019-07-12 10:49       ` Richard Sandiford

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='CAFiYyc3=vw3+XNQZCvPdbRk6Y-nGJ01VDtZDwwpmGsZYcAvx1w@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.sandiford@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).