public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: Segher Boessenkool <segher@kernel.crashing.org>
Subject: Re: [PATCH 1/2] simplify-rtx: Simplify trunc of and of shiftrt
Date: Fri, 13 Nov 2015 10:03:00 -0000	[thread overview]
Message-ID: <CAFULd4b-NbcO9PcpKgw0PtJ2jaAFy4f1jdxLZ2erNc6MHsbUOg@mail.gmail.com> (raw)

Hello!

> 2015-11-09  Segher Boessenkool  <segher@kernel.crashing.org>
>
> * gcc/simplify-rtx.c (simplify_truncation): Simplify TRUNCATE
> of AND of [LA]SHIFTRT.

Revision r230164 (the above patch) regressed:

FAIL: gcc.target/alpha/pr42269-1.c scan-assembler-not addl

on alpha-linux-gnu.

The difference starts in combine, where before the patch, we were able
to combine insns:

(insn 7 6 8 2 (set (reg:DI 82)
        (lshiftrt:DI (reg:DI 81 [ x ])
            (const_int 16 [0x10]))) pr42269-1.c:8 66 {lshrdi3}
     (expr_list:REG_DEAD (reg:DI 81 [ x ])
        (nil)))
(insn 8 7 11 2 (set (reg:DI 70 [ _2 ])
        (sign_extend:DI (subreg:SI (reg:DI 82) 0))) pr42269-1.c:8 2
{*extendsidi2_1}
     (expr_list:REG_DEAD (reg:DI 82)
        (nil)))

to:

Trying 7 -> 8:
Successfully matched this instruction:
(set (reg:DI 70 [ _2 ])
    (zero_extract:DI (reg/v:DI 80 [ x ])
        (const_int 16 [0x10])
        (const_int 16 [0x10])))
allowing combination of insns 7 and 8
original costs 4 + 4 = 8
replacement cost 4
deferring deletion of insn with uid = 7.
modifying insn i3     8: r70:DI=zero_extract(r80:DI,0x10,0x10)
deferring rescan insn with uid = 8.

After the patch, the combination fails:

Trying 7 -> 8:
Failed to match this instruction:
(set (reg:DI 70 [ _2 ])
    (sign_extend:DI (lshiftrt:SI (subreg:SI (reg/v:DI 80 [ x ]) 0)
            (const_int 16 [0x10]))))

Uros.

             reply	other threads:[~2015-11-13 10:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-13 10:03 Uros Bizjak [this message]
2015-11-13 14:36 ` Segher Boessenkool
2015-11-13 15:57   ` Uros Bizjak
  -- strict thread matches above, loose matches on Subject: below --
2015-11-09  7:33 Segher Boessenkool
2015-11-10 11:16 ` Bernd Schmidt
2015-11-10 17:44   ` Segher Boessenkool
2015-11-10 21:04     ` Bernd Schmidt
2015-11-11 14:15       ` Segher Boessenkool

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=CAFULd4b-NbcO9PcpKgw0PtJ2jaAFy4f1jdxLZ2erNc6MHsbUOg@mail.gmail.com \
    --to=ubizjak@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=segher@kernel.crashing.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: 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).