public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "phosit at autistici dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/19347] Invariant load not moved out of loop
Date: Wed, 03 Jan 2024 19:14:07 +0000	[thread overview]
Message-ID: <bug-19347-4-lCp3ACahtX@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-19347-4@http.gcc.gnu.org/bugzilla/>

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

Phosit <phosit at autistici dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |phosit at autistici dot org

--- Comment #9 from Phosit <phosit at autistici dot org> ---
When there are few iterations (likely when it is unroled) there is no
alias-check:

void fill(int* data, int& value)
{
    for(unsigned long i{0}; i != 4; ++i)
        data[i] = value;
}

--- at -O2 results in:
fill(int*, int&):
        movd    xmm1, DWORD PTR [rsi]
        pshufd  xmm0, xmm1, 0xe0
        movq    QWORD PTR [rdi], xmm0
        movd    xmm0, DWORD PTR [rsi]
        pshufd  xmm0, xmm0, 0xe0
        movq    QWORD PTR [rdi+8], xmm0
        ret

---
At -O3 the loop isn't removed and (thus) there is an alias-check.

       reply	other threads:[~2024-01-03 19:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-19347-4@http.gcc.gnu.org/bugzilla/>
2024-01-03 19:14 ` phosit at autistici dot org [this message]
2024-01-03 19:35 ` phosit at autistici dot org
     [not found] <bug-19347-9531@http.gcc.gnu.org/bugzilla/>
2005-10-24  0:20 ` pinskia at gcc dot gnu dot org
2009-04-03 12:06 ` rguenth at gcc dot gnu dot org
2005-01-09 10:51 [Bug tree-optimization/19347] New: " irar at il dot ibm dot com
2005-01-09 15:55 ` [Bug tree-optimization/19347] " pinskia at gcc dot gnu dot org
2005-04-11  6:10 ` pinskia at gcc dot gnu dot 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-19347-4-lCp3ACahtX@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).