public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/93565] [9/10 regression] Combine duplicates instructions
       [not found] <bug-93565-4@http.gcc.gnu.org/bugzilla/>
@ 2020-03-12 11:59 ` jakub at gcc dot gnu.org
  2021-06-01  8:16 ` [Bug rtl-optimization/93565] [9/10/11/12 " rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-03-12 11:59 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.3                         |9.4

--- Comment #24 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 9.3.0 has been released, adjusting target milestone.

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

* [Bug rtl-optimization/93565] [9/10/11/12 regression] Combine duplicates instructions
       [not found] <bug-93565-4@http.gcc.gnu.org/bugzilla/>
  2020-03-12 11:59 ` [Bug rtl-optimization/93565] [9/10 regression] Combine duplicates instructions jakub at gcc dot gnu.org
@ 2021-06-01  8:16 ` rguenth at gcc dot gnu.org
  2022-05-27  9:41 ` [Bug rtl-optimization/93565] [10/11/12/13 " rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-01  8:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.4                         |9.5

--- Comment #25 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9.4 is being released, retargeting bugs to GCC 9.5.

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

* [Bug rtl-optimization/93565] [10/11/12/13 regression] Combine duplicates instructions
       [not found] <bug-93565-4@http.gcc.gnu.org/bugzilla/>
  2020-03-12 11:59 ` [Bug rtl-optimization/93565] [9/10 regression] Combine duplicates instructions jakub at gcc dot gnu.org
  2021-06-01  8:16 ` [Bug rtl-optimization/93565] [9/10/11/12 " rguenth at gcc dot gnu.org
@ 2022-05-27  9:41 ` rguenth at gcc dot gnu.org
  2022-06-28 10:39 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27  9:41 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.5                         |10.4

--- Comment #26 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9 branch is being closed

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

* [Bug rtl-optimization/93565] [10/11/12/13 regression] Combine duplicates instructions
       [not found] <bug-93565-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2022-05-27  9:41 ` [Bug rtl-optimization/93565] [10/11/12/13 " rguenth at gcc dot gnu.org
@ 2022-06-28 10:39 ` jakub at gcc dot gnu.org
  2023-07-07 10:36 ` [Bug rtl-optimization/93565] [11/12/13/14 " rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:39 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.4                        |10.5

--- Comment #27 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 10.4 is being released, retargeting bugs to GCC 10.5.

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

* [Bug rtl-optimization/93565] [11/12/13/14 regression] Combine duplicates instructions
       [not found] <bug-93565-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2022-06-28 10:39 ` jakub at gcc dot gnu.org
@ 2023-07-07 10:36 ` rguenth at gcc dot gnu.org
  2024-03-27 17:50 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:36 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.5                        |11.5

--- Comment #28 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10 branch is being closed.

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

* [Bug rtl-optimization/93565] [11/12/13/14 regression] Combine duplicates instructions
       [not found] <bug-93565-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2023-07-07 10:36 ` [Bug rtl-optimization/93565] [11/12/13/14 " rguenth at gcc dot gnu.org
@ 2024-03-27 17:50 ` pinskia at gcc dot gnu.org
  2024-03-28  7:02 ` [Bug rtl-optimization/93565] [11/12/13 Regression] " rguenth at gcc dot gnu.org
  2024-04-03 16:13 ` wilco at gcc dot gnu.org
  7 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-27 17:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #29 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Looking back at this one, I (In reply to Wilco from comment #8)
> Here is a much simpler example:
> 
> void f (int *p, int y)
> {
>   int a = y & 14;
>   *p = a | p[a];
> }
After r14-9692-g839bc42772ba7af66af3bd16efed4a69511312ae, we now get:
f:
.LFB0:
        .cfi_startproc
        and     w2, w1, 14
        mov     x1, x2
        ldr     w2, [x0, x2, lsl 2]
        orr     w1, w2, w1
        str     w1, [x0]
        ret
        .cfi_endproc

There is an extra move still but the duplicated and is gone. (with
-frename-registers added, the move is gone as REE is able to remove the zero
extend but then there is a life range conflict so can't remove the move too).

So maybe this should be closed as fixed for GCC 14 and the cost changes for clz
reverted.

```
Trying 7 -> 9:
    7: r105:SI=r115:SI&0xe
      REG_DEAD r115:SI
    9: r110:DI=zero_extend(r105:SI)
Failed to match this instruction:
(parallel [
        (set (reg:DI 110 [ _1 ])
            (and:DI (subreg:DI (reg:SI 115) 0)
                (const_int 14 [0xe])))
        (set (reg/v:SI 105 [ a ])
            (and:SI (reg:SI 115)
                (const_int 14 [0xe])))
    ])
Failed to match this instruction:
(parallel [
        (set (reg:DI 110 [ _1 ])
            (and:DI (subreg:DI (reg:SI 115) 0)
                (const_int 14 [0xe])))
        (set (reg/v:SI 105 [ a ])
            (and:SI (reg:SI 115)
                (const_int 14 [0xe])))
    ])
Successfully matched this instruction:
(set (reg/v:SI 105 [ a ])
    (and:SI (reg:SI 115)
        (const_int 14 [0xe])))
Successfully matched this instruction:
(set (reg:DI 110 [ _1 ])
    (and:DI (subreg:DI (reg:SI 115) 0)
        (const_int 14 [0xe])))
allowing combination of insns 7 and 9
original costs 4 + 4 = 8
replacement costs 4 + 4 = 8
i2 didn't change, not doing this
```

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

* [Bug rtl-optimization/93565] [11/12/13 Regression] Combine duplicates instructions
       [not found] <bug-93565-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2024-03-27 17:50 ` pinskia at gcc dot gnu.org
@ 2024-03-28  7:02 ` rguenth at gcc dot gnu.org
  2024-04-03 16:13 ` wilco at gcc dot gnu.org
  7 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-03-28  7:02 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[11/12/13/14 regression]    |[11/12/13 Regression]
                   |Combine duplicates          |Combine duplicates
                   |instructions                |instructions

--- Comment #30 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed in GCC 14 (maybe those are really duplicate bugs).

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

* [Bug rtl-optimization/93565] [11/12/13 Regression] Combine duplicates instructions
       [not found] <bug-93565-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2024-03-28  7:02 ` [Bug rtl-optimization/93565] [11/12/13 Regression] " rguenth at gcc dot gnu.org
@ 2024-04-03 16:13 ` wilco at gcc dot gnu.org
  7 siblings, 0 replies; 8+ messages in thread
From: wilco at gcc dot gnu.org @ 2024-04-03 16:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #31 from Wilco <wilco at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #29)
> Looking back at this one, I (In reply to Wilco from comment #8)
> > Here is a much simpler example:
> > 
> > void f (int *p, int y)
> > {
> >   int a = y & 14;
> >   *p = a | p[a];
> > }
> After r14-9692-g839bc42772ba7af66af3bd16efed4a69511312ae, we now get:
> f:
> .LFB0:
>         .cfi_startproc
>         and     w2, w1, 14
>         mov     x1, x2
>         ldr     w2, [x0, x2, lsl 2]
>         orr     w1, w2, w1
>         str     w1, [x0]
>         ret
>         .cfi_endproc
> 
> There is an extra move still but the duplicated and is gone. (with
> -frename-registers added, the move is gone as REE is able to remove the zero
> extend but then there is a life range conflict so can't remove the move too).

Even with the mov it is better since that can be done with zero latency in
rename in most CPUs.

> So maybe this should be closed as fixed for GCC 14 and the cost changes for
> clz reverted.

The ctz costs are correct since it is a 2-instruction sequence - it only needs
adjusting for CSSC.

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

end of thread, other threads:[~2024-04-03 16:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-93565-4@http.gcc.gnu.org/bugzilla/>
2020-03-12 11:59 ` [Bug rtl-optimization/93565] [9/10 regression] Combine duplicates instructions jakub at gcc dot gnu.org
2021-06-01  8:16 ` [Bug rtl-optimization/93565] [9/10/11/12 " rguenth at gcc dot gnu.org
2022-05-27  9:41 ` [Bug rtl-optimization/93565] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:39 ` jakub at gcc dot gnu.org
2023-07-07 10:36 ` [Bug rtl-optimization/93565] [11/12/13/14 " rguenth at gcc dot gnu.org
2024-03-27 17:50 ` pinskia at gcc dot gnu.org
2024-03-28  7:02 ` [Bug rtl-optimization/93565] [11/12/13 Regression] " rguenth at gcc dot gnu.org
2024-04-03 16:13 ` wilco 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).