public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "linkw at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug testsuite/111228] [14 regression] gcc.target/powerpc/vsx-extract-6.c fails after r14-3381-g27de9aa152141e
Date: Wed, 30 Aug 2023 05:12:23 +0000	[thread overview]
Message-ID: <bug-111228-4-94eBwz0gwE@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-111228-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111228

--- Comment #2 from Kewen Lin <linkw at gcc dot gnu.org> ---
(In reply to Peter Bergner from comment #1)
> Confirmed.  The testsuite log shows for vsx-extract-6.c and vsx-extract-7.c:
> 
> gcc.target/powerpc/vsx-extract-6.c: \\mxxpermdi\\M found 2 times
> FAIL: gcc.target/powerpc/vsx-extract-6.c scan-assembler-times \\mxxpermdi\\M
> 1
> FAIL: gcc.target/powerpc/vsx-extract-6.c scan-assembler-not \\mvspltisw\\M
> 
> So we have an extra xxpermdi than we expected and we also have a vspltisw
> when we expected none.  I haven't looked at whether the code is better or
> worse though, to know whether we should just update the expected counts or
> whether this is really a code quality regression.

The commit makes the vsx-extract-6.c end up with:

test_vpasted:
.LFB0:
        .cfi_startproc
        xxspltib 0,0
        xxpermdi 34,34,0,1
        xxpermdi 34,34,35,1
        blr

instead of (the original expected):

test_vpasted:
.LFB0:
        .cfi_startproc
        xxpermdi 34,34,35,1
        blr

I think it's a code quality regression. The optimized gimple IR is changed to:

__vector unsigned long long test_vpasted (__vector unsigned long long high,
__vector unsigned long long low)
{
  __vector unsigned long long res;

  <bb 2> [local count: 1073741824]:
  res_3 = VEC_PERM_EXPR <res_2(D), high_1(D), { 0, 3 }>;
  res_5 = VEC_PERM_EXPR <low_4(D), res_3, { 0, 3 }>;
  return res_5;

}

from:

__vector unsigned long long test_vpasted (__vector unsigned long long high,
__vector unsigned long long low)
{
  __vector unsigned long long res;
  long long unsigned int _1;
  long long unsigned int _2;

  <bb 2> [local count: 1073741824]:
  _1 = BIT_FIELD_REF <high_3(D), 64, 64>;
  res_5 = BIT_INSERT_EXPR <res_4(D), _1, 64 (64 bits)>;
  _2 = BIT_FIELD_REF <low_6(D), 64, 0>;
  res_7 = BIT_INSERT_EXPR <res_5, _2, 0 (64 bits)>;
  return res_7;

}

For gimple IRs:

  res_3 = VEC_PERM_EXPR <res_2(D), high_1(D), { 0, 3 }>;
  res_5 = VEC_PERM_EXPR <low_4(D), res_3, { 0, 3 }>;

I'd expect it can be further optimized into

  res_5 = VEC_PERM_EXPR <low_4(D), high_1(D), { 0, 3 }>;

  parent reply	other threads:[~2023-08-30  5:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-29 19:00 [Bug testsuite/111228] New: " seurer at gcc dot gnu.org
2023-08-30  3:26 ` [Bug testsuite/111228] " bergner at gcc dot gnu.org
2023-08-30  5:12 ` linkw at gcc dot gnu.org [this message]
2023-08-30  7:17 ` rguenth at gcc dot gnu.org
2023-08-30 11:55 ` cvs-commit at gcc dot gnu.org
2023-08-30 11:55 ` rguenth at gcc dot gnu.org
2023-08-30 14:41 ` bergner at gcc dot gnu.org
2023-08-31 13:57 ` cvs-commit at gcc dot gnu.org
2023-08-31 13:58 ` bergner at gcc dot gnu.org

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=bug-111228-4-94eBwz0gwE@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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).