public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: Kewen Lin <linkw@linux.ibm.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH 12/15] i386: Fix non-robust split condition in define_insn_and_split
Date: Wed, 17 Nov 2021 08:13:00 +0100	[thread overview]
Message-ID: <CAFULd4Ywm7FSVqUfGS956_-z-vc7qQO3o1Jc400MjFbUQVSrQw@mail.gmail.com> (raw)
In-Reply-To: <7791d23e4be91943d8c6d0ec56493827011e3b96.1636621345.git.linkw@linux.ibm.com>

On Thu, Nov 11, 2021 at 12:25 PM Kewen Lin <linkw@linux.ibm.com> wrote:
>
> This patch is to fix some non-robust split conditions in some
> define_insn_and_splits, to make each of them applied on top of
> the corresponding condition for define_insn part, otherwise the
> splitting could perform unexpectedly.
>
> gcc/ChangeLog:
>
>         * config/i386/i386.md (*add<dwi>3_doubleword, *addv<dwi>4_doubleword,
>         *addv<dwi>4_doubleword_1, *sub<dwi>3_doubleword,
>         *subv<dwi>4_doubleword, *subv<dwi>4_doubleword_1,
>         *add<dwi>3_doubleword_cc_overflow_1, *divmodsi4_const,
>         *neg<dwi>2_doubleword, *tls_dynamic_gnu2_combine_64_<mode>): Fix split
>         condition.

OK.

Thanks,
Uros.

> ---
>  gcc/config/i386/i386.md | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
> index 6eb9de81921..2bd09e502ae 100644
> --- a/gcc/config/i386/i386.md
> +++ b/gcc/config/i386/i386.md
> @@ -5491,7 +5491,7 @@ (define_insn_and_split "*add<dwi>3_doubleword"
>     (clobber (reg:CC FLAGS_REG))]
>    "ix86_binary_operator_ok (PLUS, <DWI>mode, operands)"
>    "#"
> -  "reload_completed"
> +  "&& reload_completed"
>    [(parallel [(set (reg:CCC FLAGS_REG)
>                    (compare:CCC
>                      (plus:DWIH (match_dup 1) (match_dup 2))
> @@ -6300,7 +6300,7 @@ (define_insn_and_split "*addv<dwi>4_doubleword"
>         (plus:<DWI> (match_dup 1) (match_dup 2)))]
>    "ix86_binary_operator_ok (PLUS, <DWI>mode, operands)"
>    "#"
> -  "reload_completed"
> +  "&& reload_completed"
>    [(parallel [(set (reg:CCC FLAGS_REG)
>                    (compare:CCC
>                      (plus:DWIH (match_dup 1) (match_dup 2))
> @@ -6347,7 +6347,7 @@ (define_insn_and_split "*addv<dwi>4_doubleword_1"
>     && CONST_SCALAR_INT_P (operands[2])
>     && rtx_equal_p (operands[2], operands[3])"
>    "#"
> -  "reload_completed"
> +  "&& reload_completed"
>    [(parallel [(set (reg:CCC FLAGS_REG)
>                    (compare:CCC
>                      (plus:DWIH (match_dup 1) (match_dup 2))
> @@ -6641,7 +6641,7 @@ (define_insn_and_split "*sub<dwi>3_doubleword"
>     (clobber (reg:CC FLAGS_REG))]
>    "ix86_binary_operator_ok (MINUS, <MODE>mode, operands)"
>    "#"
> -  "reload_completed"
> +  "&& reload_completed"
>    [(parallel [(set (reg:CC FLAGS_REG)
>                    (compare:CC (match_dup 1) (match_dup 2)))
>               (set (match_dup 0)
> @@ -6817,7 +6817,7 @@ (define_insn_and_split "*subv<dwi>4_doubleword"
>         (minus:<DWI> (match_dup 1) (match_dup 2)))]
>    "ix86_binary_operator_ok (MINUS, <MODE>mode, operands)"
>    "#"
> -  "reload_completed"
> +  "&& reload_completed"
>    [(parallel [(set (reg:CC FLAGS_REG)
>                    (compare:CC (match_dup 1) (match_dup 2)))
>               (set (match_dup 0)
> @@ -6862,7 +6862,7 @@ (define_insn_and_split "*subv<dwi>4_doubleword_1"
>     && CONST_SCALAR_INT_P (operands[2])
>     && rtx_equal_p (operands[2], operands[3])"
>    "#"
> -  "reload_completed"
> +  "&& reload_completed"
>    [(parallel [(set (reg:CC FLAGS_REG)
>                    (compare:CC (match_dup 1) (match_dup 2)))
>               (set (match_dup 0)
> @@ -7542,7 +7542,7 @@ (define_insn_and_split "*add<dwi>3_doubleword_cc_overflow_1"
>         (plus:<DWI> (match_dup 1) (match_dup 2)))]
>    "ix86_binary_operator_ok (PLUS, <DWI>mode, operands)"
>    "#"
> -  "reload_completed"
> +  "&& reload_completed"
>    [(parallel [(set (reg:CCC FLAGS_REG)
>                    (compare:CCC
>                      (plus:DWIH (match_dup 1) (match_dup 2))
> @@ -9000,7 +9000,7 @@ (define_insn_and_split "*divmodsi4_const"
>     (clobber (reg:CC FLAGS_REG))]
>    "!optimize_function_for_size_p (cfun)"
>    "#"
> -  "reload_completed"
> +  "&& reload_completed"
>    [(set (match_dup 0) (match_dup 2))
>     (set (match_dup 1) (match_dup 4))
>     (parallel [(set (match_dup 0)
> @@ -10515,7 +10515,7 @@ (define_insn_and_split "*neg<dwi>2_doubleword"
>     (clobber (reg:CC FLAGS_REG))]
>    "ix86_unary_operator_ok (NEG, <DWI>mode, operands)"
>    "#"
> -  "reload_completed"
> +  "&& reload_completed"
>    [(parallel
>      [(set (reg:CCC FLAGS_REG)
>           (ne:CCC (match_dup 1) (const_int 0)))
> @@ -16898,7 +16898,7 @@ (define_insn_and_split "*tls_dynamic_gnu2_combine_64_<mode>"
>     (clobber (reg:CC FLAGS_REG))]
>    "TARGET_64BIT && TARGET_GNU2_TLS"
>    "#"
> -  ""
> +  "&& 1"
>    [(set (match_dup 0) (match_dup 4))]
>  {
>    operands[4] = can_create_pseudo_p () ? gen_reg_rtx (ptr_mode) : operands[0];
> --
> 2.27.0
>

  reply	other threads:[~2021-11-17  7:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-11 11:24 [PATCH 00/15] " Kewen Lin
2021-11-11 11:24 ` [PATCH 01/15] frv: " Kewen Lin
2021-11-11 11:24 ` [PATCH 02/15] m32c: " Kewen Lin
2021-11-11 11:24 ` [PATCH 03/15] rx: " Kewen Lin
2021-11-11 11:24 ` [PATCH 04/15] s390: " Kewen Lin
2021-11-11 11:24 ` [PATCH 05/15] v850: " Kewen Lin
2021-11-11 11:24 ` [PATCH 06/15] visium: " Kewen Lin
2021-11-16 16:57   ` Eric Botcazou
2021-11-17  6:06     ` Kewen.Lin
2021-11-11 11:24 ` [PATCH 07/15] xtensa: " Kewen Lin
2021-11-19 22:26   ` augustine.sterling
2021-11-22  2:21     ` Kewen.Lin
2021-11-11 11:24 ` [PATCH 08/15] alpha: " Kewen Lin
2021-11-11 11:24 ` [PATCH 09/15] arm: " Kewen Lin
2021-11-11 11:24 ` [PATCH 10/15] bfin: " Kewen Lin
2021-11-11 11:24 ` [PATCH 11/15] csky: " Kewen Lin
2021-11-11 11:24 ` [PATCH 12/15] i386: " Kewen Lin
2021-11-17  7:13   ` Uros Bizjak [this message]
2021-11-17 10:06     ` Kewen.Lin
2021-11-11 11:24 ` [PATCH 13/15] ia64: " Kewen Lin
2021-11-11 11:24 ` [PATCH 14/15] mips: " Kewen Lin
2021-11-11 11:24 ` [PATCH 15/15] sh: " Kewen Lin

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=CAFULd4Ywm7FSVqUfGS956_-z-vc7qQO3o1Jc400MjFbUQVSrQw@mail.gmail.com \
    --to=ubizjak@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=linkw@linux.ibm.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).