public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/114510] New: [14 Regression] missed proping of multiply by 2 into address of load/stores
@ 2024-03-28  6:58 pinskia at gcc dot gnu.org
  2024-03-28  7:05 ` [Bug target/114510] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-28  6:58 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114510
           Summary: [14 Regression] missed proping of multiply by 2 into
                    address of load/stores
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---
            Target: aarch64

Take:
```
int f(short *a, short *c, __SIZE_TYPE__ b)
{
        return a[b] + c[b];
}

int f1(short *a, short *c, int b)
{
        return a[b] + c[b];
}
```
These used to produce in GCC 13:
```
f:
        ldrsh   w3, [x0, x2, lsl 1]
        ldrsh   w0, [x1, x2, lsl 1]
        add     w0, w3, w0
        ret
f1:
        ldrsh   w3, [x0, w2, sxtw 1]
        ldrsh   w0, [x1, w2, sxtw 1]
        add     w0, w3, w0
        ret
```

But now f produces as of r14-9692-g839bc42772ba7a (but it looks like the change
happened much earlier):
```
f:
        lsl     x2, x2, 1
        ldrsh   w3, [x0, x2]
        ldrsh   w0, [x1, x2]
        add     w0, w3, w0
```

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/114510] [14 Regression] missed proping of multiply by 2 into address of load/stores
  2024-03-28  6:58 [Bug target/114510] New: [14 Regression] missed proping of multiply by 2 into address of load/stores pinskia at gcc dot gnu.org
@ 2024-03-28  7:05 ` pinskia at gcc dot gnu.org
  2024-03-28  7:05 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-28  7:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note it looks like fwprop was doing it in GCC 13 but not on the trunk due to a
cost reason. I have not looked further. There could be some cost issues in the
aarch64 backend dealing with address costs too.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/114510] [14 Regression] missed proping of multiply by 2 into address of load/stores
  2024-03-28  6:58 [Bug target/114510] New: [14 Regression] missed proping of multiply by 2 into address of load/stores pinskia at gcc dot gnu.org
  2024-03-28  7:05 ` [Bug target/114510] " pinskia at gcc dot gnu.org
@ 2024-03-28  7:05 ` pinskia at gcc dot gnu.org
  2024-03-28  7:08 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-28  7:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note I was inspired to test this due to LLVM change:
https://github.com/llvm/llvm-project/pull/86894 .

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/114510] [14 Regression] missed proping of multiply by 2 into address of load/stores
  2024-03-28  6:58 [Bug target/114510] New: [14 Regression] missed proping of multiply by 2 into address of load/stores pinskia at gcc dot gnu.org
  2024-03-28  7:05 ` [Bug target/114510] " pinskia at gcc dot gnu.org
  2024-03-28  7:05 ` pinskia at gcc dot gnu.org
@ 2024-03-28  7:08 ` pinskia at gcc dot gnu.org
  2024-03-29 23:45 ` law at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-28  7:08 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/114510] [14 Regression] missed proping of multiply by 2 into address of load/stores
  2024-03-28  6:58 [Bug target/114510] New: [14 Regression] missed proping of multiply by 2 into address of load/stores pinskia at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2024-03-28  7:08 ` pinskia at gcc dot gnu.org
@ 2024-03-29 23:45 ` law at gcc dot gnu.org
  2024-04-03 16:16 ` tnfchris at gcc dot gnu.org
  2024-05-07  7:45 ` [Bug target/114510] [14/15 " rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: law at gcc dot gnu.org @ 2024-03-29 23:45 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |law at gcc dot gnu.org
           Priority|P3                          |P2

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/114510] [14 Regression] missed proping of multiply by 2 into address of load/stores
  2024-03-28  6:58 [Bug target/114510] New: [14 Regression] missed proping of multiply by 2 into address of load/stores pinskia at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2024-03-29 23:45 ` law at gcc dot gnu.org
@ 2024-04-03 16:16 ` tnfchris at gcc dot gnu.org
  2024-05-07  7:45 ` [Bug target/114510] [14/15 " rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2024-04-03 16:16 UTC (permalink / raw)
  To: gcc-bugs

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

Tamar Christina <tnfchris at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tnfchris at gcc dot gnu.org

--- Comment #3 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
Richard's patch should fix this next year.

https://gcc.gnu.org/pipermail/gcc-patches/2023-October/634166.html

We'll then stop relying on combine or other passes to fix this.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/114510] [14/15 Regression] missed proping of multiply by 2 into address of load/stores
  2024-03-28  6:58 [Bug target/114510] New: [14 Regression] missed proping of multiply by 2 into address of load/stores pinskia at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2024-04-03 16:16 ` tnfchris at gcc dot gnu.org
@ 2024-05-07  7:45 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-05-07  7:45 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|14.0                        |14.2

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 14.1 is being released, retargeting bugs to GCC 14.2.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-05-07  7:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-28  6:58 [Bug target/114510] New: [14 Regression] missed proping of multiply by 2 into address of load/stores pinskia at gcc dot gnu.org
2024-03-28  7:05 ` [Bug target/114510] " pinskia at gcc dot gnu.org
2024-03-28  7:05 ` pinskia at gcc dot gnu.org
2024-03-28  7:08 ` pinskia at gcc dot gnu.org
2024-03-29 23:45 ` law at gcc dot gnu.org
2024-04-03 16:16 ` tnfchris at gcc dot gnu.org
2024-05-07  7:45 ` [Bug target/114510] [14/15 " rguenth at gcc dot gnu.org

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).