public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenther at suse dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/102543] -march=cascadelake performs odd alignment peeling
Date: Wed, 13 Oct 2021 07:25:43 +0000	[thread overview]
Message-ID: <bug-102543-4-ZODXSOhBdG@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102543-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #10 from rguenther at suse dot de <rguenther at suse dot de> ---
On Wed, 13 Oct 2021, crazylht at gmail dot com wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102543
> 
> --- Comment #9 from Hongtao.liu <crazylht at gmail dot com> ---
> I'm curious why we need peeling for unaligned access, because unaligned access
> instructions should also be available for aligned addresses, can't we just mark
> mem_ref as unaligned (although this is fake, just to generate unaligned
> instructions for the back end only)

The costing is not for movaps vs movups but for movups on aligned vs. 
unaligned storage.  So to make the access fast the costing tells us
that the access has to be actually unaligned.

Anyhow, the vectorizer does not consider to actively misalign in
case all accesses are known to be aligned - but what happens is
that if there's at least one unaligned access it evaluates the
costs of aligning that access vs. aligning the other accesses
and the bug makes it appear that aligning a single access is
cheaper than aligning multiple accesses (even if those are already
aligned and thus would require no peeling at all).

  parent reply	other threads:[~2021-10-13  7:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-30 10:13 [Bug target/102543] New: " rguenth at gcc dot gnu.org
2021-09-30 10:14 ` [Bug target/102543] " rguenth at gcc dot gnu.org
2021-10-06 15:00 ` rguenth at gcc dot gnu.org
2021-10-08  9:04 ` crazylht at gmail dot com
2021-10-08  9:49 ` crazylht at gmail dot com
2021-10-08 10:07 ` rguenther at suse dot de
2021-10-08 10:43 ` rguenth at gcc dot gnu.org
2021-10-11  2:19 ` crazylht at gmail dot com
2021-10-12 12:53 ` rguenth at gcc dot gnu.org
2021-10-13  1:20 ` crazylht at gmail dot com
2021-10-13  7:25 ` rguenther at suse dot de [this message]
2021-11-19  1:23 ` cvs-commit at gcc dot gnu.org
2023-11-30  8:53 ` liuhongt 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-102543-4-ZODXSOhBdG@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).