[Bug target/102758] [12 Regression] Failure to use registers optimally with return values (2 operands related and subreg)

2021-12-03 Thread rsandifo at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102758

--- Comment #4 from rsandifo at gcc dot gnu.org  
---
(In reply to Richard Biener from comment #3)
> Richard?  How does the new fwprop behave wrt hardregs?
It doesn't sound like this is new vs. old fwprop, since new fwprop
was in GCC 11.  Generally the idea was to follow the existing
behaviour as closely as possible, so I don't know of any specific
differences re: hard regs.

[Bug target/102758] [12 Regression] Failure to use registers optimally with return values (2 operands related and subreg)

2021-10-15 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102758

Richard Biener  changed:

   What|Removed |Added

 CC||rsandifo at gcc dot gnu.org

--- Comment #3 from Richard Biener  ---
Richard?  How does the new fwprop behave wrt hardregs?

[Bug target/102758] [12 Regression] Failure to use registers optimally with return values (2 operands related and subreg)

2021-10-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102758

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |minor
   Keywords|needs-bisection |
Summary|[12 Regression] Failure to  |[12 Regression] Failure to
   |use registers optimally |use registers optimally
   |with return values (2   |with return values (2
   |operands related)   |operands related and
   ||subreg)

--- Comment #2 from Andrew Pinski  ---
So the difference in the IR happens from forwprop.
before RA we have this for the old compiler:
(insn 9 8 14 2 (set (reg:V8HI 89)
(plus:V8HI (reg:V8HI 90)
(subreg:V8HI (reg:V2DI 91) 0))) "/app/example.cpp":8:29 3418
{*addv8hi3}
 (expr_list:REG_DEAD (reg:V2DI 91)
(expr_list:REG_DEAD (reg:V8HI 90)
(nil
(insn 14 9 15 2 (set (reg/i:V2DI 20 xmm0)
(subreg:V2DI (reg:V8HI 89) 0)) "/app/example.cpp":9:1 1439
{movv2di_internal}
 (expr_list:REG_DEAD (reg:V8HI 89)
(nil)))

With the new compile we have:
(insn 10 9 14 2 (set (subreg:V8HI (reg:V2DI 84 [  ]) 0)
(plus:V8HI (reg:V8HI 90)
(subreg:V8HI (reg:V2DI 91) 0))) "/app/example.cpp":8:41 5787
{*addv8hi3}
 (expr_list:REG_DEAD (reg:V8HI 90)
(expr_list:REG_DEAD (reg:V2DI 91)
(nil
(insn 14 10 15 2 (set (reg/i:V2DI 20 xmm0)
(reg:V2DI 84 [  ])) "/app/example.cpp":9:1 1634
{movv2di_internal}
 (expr_list:REG_DEAD (reg:V2DI 84 [  ])
(nil)))

This now confuses the register allocator.

So this is only an issue with return because of the hard register being
involved. So this is a minor issue and not much of a problem unless you are
doing microbenchmarking.

[Bug target/102758] [12 Regression] Failure to use registers optimally with return values (2 operands related)

2021-10-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102758

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2021-10-15
 Status|UNCONFIRMED |NEW
  Known to work||11.2.0
   Target Milestone|--- |12.0
Summary|[x86] Failure to use|[12 Regression] Failure to
   |registers optimally when|use registers optimally
   |swapping between|with return values (2
   |(identically represented)   |operands related)
   |vector types|
  Known to fail||12.0

--- Comment #1 from Andrew Pinski  ---
GCC 11.2.0 (and before) produces:
movdqa  .LC0(%rip), %xmm0
paddw   %xmm1, %xmm0
ret

Which is what you want.
I don't know why trunk changed ...