[0/3] GCC13/GCC12 backport [PR108707][PR109610]

Message ID 20250210054320.1014838-1-hongtao.liu@intel.com
Headers
Series GCC13/GCC12 backport [PR108707][PR109610] |

Message

Liu, Hongtao Feb. 10, 2025, 5:43 a.m. UTC
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108707#c9

>Pranav Gorantla 2025-02-06 04:30:05 UTC
>Facing similar issue in gcc-13. Is it possible to backport the fix of this Bug 108707 and Bug 109610 to gcc-13, gcc-12 as well.

This series is to ask approval for the backport of r14-172 and r14-1252 to GCC13 and GCC12 release branch.
Note r14-1252 is a fix to r14-172 which regressed powerpc testcase in PR109610.
I have verified the fix also works on GCC13/GCC12 branch for PR109610.

Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}, and aarch64-linux-gnu.
Ok for backport


liuhongt (3):
  Use NO_REGS in cost calculation when the preferred register class are
    not known yet.
  Only use NO_REGS in cost calculation when !hard_regno_mode_ok for
    GENERAL_REGS and mode.
  Adjust testcases after better RA decision.

 gcc/ira-costs.cc                              |   7 +
 .../i386/avx2-dest-false-dep-for-glc.c        |  28 +-
 .../i386/avx512dq-dest-false-dep-for-glc.c    | 257 ++++++++++---
 .../i386/avx512f-dest-false-dep-for-glc.c     | 348 ++++++++++++++----
 .../i386/avx512fp16-dest-false-dep-for-glc.c  | 118 ++++--
 .../i386/avx512vl-dest-false-dep-for-glc.c    | 243 +++++++++---
 gcc/testsuite/gcc.target/i386/pr108707.c      |  16 +
 7 files changed, 813 insertions(+), 204 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/i386/pr108707.c
  

Comments

Hongtao Liu Feb. 10, 2025, 5:43 a.m. UTC | #1
On Mon, Feb 10, 2025 at 1:43 PM liuhongt <hongtao.liu@intel.com> wrote:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108707#c9
>
> >Pranav Gorantla 2025-02-06 04:30:05 UTC
> >Facing similar issue in gcc-13. Is it possible to backport the fix of this Bug 108707 and Bug 109610 to gcc-13, gcc-12 as well.
>
> This series is to ask approval for the backport of r14-172 and r14-1252 to GCC13 and GCC12 release branch.
> Note r14-1252 is a fix to r14-172 which regressed powerpc testcase in PR109610.
> I have verified the fix also works on GCC13/GCC12 branch for PR109610.
>
> Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}, and aarch64-linux-gnu.
> Ok for backport
>
>
> liuhongt (3):
>   Use NO_REGS in cost calculation when the preferred register class are
>     not known yet.
>   Only use NO_REGS in cost calculation when !hard_regno_mode_ok for
>     GENERAL_REGS and mode.
>   Adjust testcases after better RA decision.
>
>  gcc/ira-costs.cc                              |   7 +
>  .../i386/avx2-dest-false-dep-for-glc.c        |  28 +-
>  .../i386/avx512dq-dest-false-dep-for-glc.c    | 257 ++++++++++---
>  .../i386/avx512f-dest-false-dep-for-glc.c     | 348 ++++++++++++++----
>  .../i386/avx512fp16-dest-false-dep-for-glc.c  | 118 ++++--
>  .../i386/avx512vl-dest-false-dep-for-glc.c    | 243 +++++++++---
>  gcc/testsuite/gcc.target/i386/pr108707.c      |  16 +
>  7 files changed, 813 insertions(+), 204 deletions(-)
>  create mode 100644 gcc/testsuite/gcc.target/i386/pr108707.c
>
> --
> 2.34.1
>
  
Richard Biener Feb. 10, 2025, 7:39 a.m. UTC | #2
On Mon, Feb 10, 2025 at 6:46 AM liuhongt <hongtao.liu@intel.com> wrote:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108707#c9
>
> >Pranav Gorantla 2025-02-06 04:30:05 UTC
> >Facing similar issue in gcc-13. Is it possible to backport the fix of this Bug 108707 and Bug 109610 to gcc-13, gcc-12 as well.
>
> This series is to ask approval for the backport of r14-172 and r14-1252 to GCC13 and GCC12 release branch.
> Note r14-1252 is a fix to r14-172 which regressed powerpc testcase in PR109610.
> I have verified the fix also works on GCC13/GCC12 branch for PR109610.
>
> Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}, and aarch64-linux-gnu.
> Ok for backport

No, please avoid backporting missed-optimization fixes, esp. in code
areas as sensitive as RA.
The only exception should be the newest active branch (gcc-14) at this
point, and even there
you need to be very careful.  The PR itself isn't even marked as
regression btw. (not that this
would change my assessment much).

Thanks,
Richard.

>
> liuhongt (3):
>   Use NO_REGS in cost calculation when the preferred register class are
>     not known yet.
>   Only use NO_REGS in cost calculation when !hard_regno_mode_ok for
>     GENERAL_REGS and mode.
>   Adjust testcases after better RA decision.
>
>  gcc/ira-costs.cc                              |   7 +
>  .../i386/avx2-dest-false-dep-for-glc.c        |  28 +-
>  .../i386/avx512dq-dest-false-dep-for-glc.c    | 257 ++++++++++---
>  .../i386/avx512f-dest-false-dep-for-glc.c     | 348 ++++++++++++++----
>  .../i386/avx512fp16-dest-false-dep-for-glc.c  | 118 ++++--
>  .../i386/avx512vl-dest-false-dep-for-glc.c    | 243 +++++++++---
>  gcc/testsuite/gcc.target/i386/pr108707.c      |  16 +
>  7 files changed, 813 insertions(+), 204 deletions(-)
>  create mode 100644 gcc/testsuite/gcc.target/i386/pr108707.c
>
> --
> 2.34.1
>